UE4 C++ Inventory : Pickup

  Рет қаралды 14,733

Jayanam

Jayanam

Күн бұрын

Пікірлер
@MPatrickDearman
@MPatrickDearman 7 жыл бұрын
I'm using 4.16.1 Had to add #include "Components/BoxComponent.h" before the #include "PickupActor.generated.h" line in PickupActor.h for this to work. Great tutorials though. They are helping me a lot.
@JayAnAm
@JayAnAm 7 жыл бұрын
Hi and thx. Well, what you can also do is to define the BoxCollision as UShapeComponent then you don't need to include, the internal cast to BoxCollision is done in the implementation when creating the component.
@MPatrickDearman
@MPatrickDearman 7 жыл бұрын
I'm assuming what you mean is to use "UShapeComponent* BoxCollider;" instead of "UBoxComponent..." This did not work either, unless I misunderstood what you meant.
@JayAnAm
@JayAnAm 7 жыл бұрын
Yes, like this, then you just have to add CoreMinimal.h You can also check my upload here for a Cube that uses this: www.patreon.com/posts/12138285 C++ code for the actor is in the posting's text
@MPatrickDearman
@MPatrickDearman 7 жыл бұрын
Jay AnAm CoreMinimal is there by default yet declaring BoxCollider as UShapeComoonent still does not work unless it is Included as I had to do with UBoxComponent. It's really aggravating how quickly engine source gets updated and breaks all of these awesome tutorials. Oh well I guess... I'm still learning a lot.
@robertbereza6335
@robertbereza6335 7 жыл бұрын
Had the same problem, and I also had to include "Engine.h" in order to use GEngine->AddOnScreenDebugMessage()
@pollovaldes
@pollovaldes 4 жыл бұрын
If you are using a recent version of UE4, instead of writing "bGenerateOverlapEvents = true" write "SetGenerateOverlapEvents(true)"
@michaelivanov1605
@michaelivanov1605 4 жыл бұрын
Хороший урок! У кого не работает это "Box->bGenerateOverlapEvents = true;", попробуйте "Box->SetGenerateOverlapEvents(true);".
@FreemanTraceur
@FreemanTraceur 6 жыл бұрын
For anyone reading this, if you want to copy the signature of overlapbegin (or any other built-in event) you can actually find it from their respective header files included with the unreal dev tools for VS. In this case the header file is, PrimitiveComponent.h , you don't have to include this file in the cpp file. Just open the header file and find the function, copy the signature, there will be a bunch of extra commas separating the variable names from the data types, so you'll have to get rid of those and then just do whatever you want to. This is extremely useful because, the signatures of events and functions may get changed and this way you'll get the required signature.
@tsubarider13
@tsubarider13 6 жыл бұрын
Great tutorial dude! Didn't understand how to implement overlap events before I watched this video. Thanks :)
@BauTekIndustries
@BauTekIndustries 4 жыл бұрын
These videos are great, thanks for putting them together! I'm going through these with UE version 4.24 and there are a couple of changes they must've made that required the following revisions: 1. The 'this->BoxCollider->OnComponentBeginOverlap.AddDynamic' had to be moved to APickupActor::BeginPlay() before Super::BeginPlay() is called 2. I had to add '#include "Engine/Engine.h"' into PickupActor.cpp to access anything in GEngine 3. As other mentioned, had to add '#include "Components/BoxComponent.h"' into PickupActor.h Thanks for putting these tutorials together, looking forward to working through the rest of the series!
@nipunmarak5805
@nipunmarak5805 6 жыл бұрын
I added #include "Cpomponents/UBoxComponent.h" . But still it's not working and showing error C2248: 'UPrimitiveComponent::bGenerateOverlapEvents': cannot access private member declared in class 'UPrimitiveComponent' And I'm using version 4.20.3 What can i do?
@aliang8373
@aliang8373 6 жыл бұрын
i use 'this->BoxCollider->SetGenerateOverlapEvents(true)' to replace;
@nipunmarak5805
@nipunmarak5805 6 жыл бұрын
​Great man... It works. Thank you
@corygaga5930
@corygaga5930 5 жыл бұрын
@@aliang8373 thank you,I met the same problem,finally found you, otherwise i will give up
@jobchen5019
@jobchen5019 6 жыл бұрын
That's great!!!!!!!but I have a question.......why my code is follow your video,【FString pickup = FString::Printf(TEXT("Picked up: %s"), *GetName()); GEngine->AddOnScreenDebugMessage(1, 5, FColor::Red, pickup);】....this is successed for the code.. and when I push "play" and get the object after.....it is not display any "ObjectName string" in viewport ....
@SlumpogMillionaire
@SlumpogMillionaire 7 жыл бұрын
Just tried doing this without any tutorials... found out the hard way that you need the UFUNCTION() macro above the declaration for the overlap to work. This drove me nuts for over an hour because not only does the trigger overlap not work without the macro, but it also doesn't give any compile errors or warnings when compiling.
@stompeee
@stompeee 7 жыл бұрын
What advantage does creating OnOverlapBegin have, rather than just using OnActorOverlapBegin?
@FreemanTraceur
@FreemanTraceur 6 жыл бұрын
I know I'm late, but creating OnOverlapBegin allows you to do something specific for specific component overlaps, while the OnActorOverlapBegin will consider the entire actor. It'll work here but not for complex actors, with various components.
@tiptopboy88
@tiptopboy88 7 жыл бұрын
thanks , plz determine UE4's version of each C++ tutorial.
@JayAnAm
@JayAnAm 7 жыл бұрын
Ok, you are right, will add it. This one is 4.15.
@ReubenAStern
@ReubenAStern 4 жыл бұрын
Is it just me or has the Collision been changed as of UE4.24? I think they may have done this to get the chaos thing to work.
@千八歳
@千八歳 2 жыл бұрын
Thank you very much from China;
@GameDevBeat
@GameDevBeat 6 жыл бұрын
i have used both Unreal and unity and currently my project in unreal with blueprint but i see C# way much more simpler than C++ to do all this... in Unity the collision > and check for tags or what ever
@s-c-iulian
@s-c-iulian 7 жыл бұрын
1:31 does it have something like that ? :D
@JayAnAm
@JayAnAm 7 жыл бұрын
Of course, and a good one: docs.unrealengine.com/latest/INT/API/index.html
@andrew.r.lukasik
@andrew.r.lukasik 3 жыл бұрын
Thanks!
@bertani6134
@bertani6134 4 жыл бұрын
Amazing!!!!!!!!!!!!
@GPTDavid
@GPTDavid 7 жыл бұрын
Your videos are just fantastic.. You need a lot more subscribers, a lot more likes. Great job!
@JayAnAm
@JayAnAm 7 жыл бұрын
:-) Thank you!
@IJUSTLOVEPC
@IJUSTLOVEPC 7 жыл бұрын
Hello first of all great vids but i have some questions. First of all why do we make all UStaticMesh, AActor pointers? I know what a pointer is but i have a hard time understanding when to use them in ue4 c++ code. And when we 'AddDynamic(this, &APickUpActor::OnActorBeginOverlap)' Why did we put a ampersand (adress of) operator? I know we use the '&' before out parameters. Example Int32 SizeX, SizeY GetViewPortSize (&SizeX, &SizeY) I Know we get the adress to the int32 so when the method find the viewport size it finds the adress of the int32 and modifes its values instead of creating a copy that gets lost when out of scope. But i do not underatand why we use them in AddDynamic or when to use '&' more than in out parameters?
@JayAnAm
@JayAnAm 7 жыл бұрын
Hi, pointers are used here because we want to hold these objects on the heap, not on the stack. In AddDynamics the OnActorBeginOverlap is a function-pointer, in C# this is done with delegates, that's why you need the address of this method in memory.
@IJUSTLOVEPC
@IJUSTLOVEPC 7 жыл бұрын
I Think i have got a grasp about why we use pointers. When we do "UStaticMesh* CubeMesh" the "UStaticMesh" is a class itself and instead of copying UStaticMesh class with "UStaticMesh CubeMesh", we just Point to it location in memory so it would be more efficient! Im kind of right, right?
@unrealper6284
@unrealper6284 5 жыл бұрын
want to know too
@tulczi
@tulczi 7 жыл бұрын
Very nice video! Kind regards for such great explanation.
@JayAnAm
@JayAnAm 7 жыл бұрын
Thx a lot!
@dansuricato6828
@dansuricato6828 7 жыл бұрын
Hi, I'm wondering ...how could an Actor be NULL?
@JayAnAm
@JayAnAm 7 жыл бұрын
If you declare it as variable but don't create and assign it.
@wayzeranime8210
@wayzeranime8210 7 жыл бұрын
I am always waiting for more from you 😉😉
@JayAnAm
@JayAnAm 7 жыл бұрын
:-) thx a lot, like my videos if you do and if you have any special wishes let me know.
@wayzeranime8210
@wayzeranime8210 7 жыл бұрын
Jay AnAm OK I will start my first game i the next it is an endless runner game do you mind if you explain better the random terrain generation and the work of the nodes included or just make it in c++ , thanks 😉😉😀.
@JayAnAm
@JayAnAm 7 жыл бұрын
ok, thx will put it to my list.
@wayzeranime8210
@wayzeranime8210 7 жыл бұрын
Jay AnAm I'm waiting for your notification 😅😅
@MrPain4Blood
@MrPain4Blood 7 жыл бұрын
Great tutorial! Make more UE4 C++ videos!
@JayAnAm
@JayAnAm 7 жыл бұрын
Ok, I will!
UE4 C++ Tutorial : Rotating Pickup
8:47
Jayanam
Рет қаралды 16 М.
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 41 МЛН
UE4 C++ Inventory : Add Items
12:28
Jayanam
Рет қаралды 10 М.
Unreal Engine C++ Tutorial - Episode 2: Pickups
13:56
reubs
Рет қаралды 58 М.
UE4 C++ Inventory UI : Show Items
12:42
Jayanam
Рет қаралды 11 М.
Unreal Engine C++ Tutorial #7 - Inventory System
29:04
reubs
Рет қаралды 33 М.
Unreal Engine 4 Tutorial: Inventory Drag 'n Drop (2)
8:49
Unreal Engine Inventory Blueprints : Drop Items
7:12
Jayanam
Рет қаралды 10 М.
2019 Ultimate Unreal C++ Guide - Episode 1
14:07
reubs
Рет қаралды 216 М.
Unigine 2.19.1 Update
9:28
Lazy Unigine Dude
Рет қаралды 740
UE4 C++ beginner tutorial
7:45
Jayanam
Рет қаралды 46 М.