C++ - BlueprintSpawnableComponent vs CreateDefaultSubobject Which is better?
i just started learning c++ for Unreal
now i came up with this situation: You have for example "MovementComponent" and you want place it as a component in your "Character" then i saw two ways of doing it
1) Create protected variable MovementComponent then set it in the constructor of the character like:
So you use the method CreateDefaultSubobject
2) Add on the MovementComponent.h file inside the UCLASS() this:
And then just go to your character and click add component and you will find the Component.
Now i wondered which one is better qua performance and features One thing i know is with method 2 you also have is as a variable in your character blueprint
Edit: And with one should i use??
Follow this question
Once you sign in you will be able to subscribe for any updates here