AddChildActor via function C++
I've been trying to get versed with UE4 C++ now as I think I have become pretty familiar with blueprints. I made a game using blueprints and now I'm trying to replicate the same using C++. I've hit a roadblock and cannot find a proper solution.
Summarizing what I need is -
I have a Blueprint actor that I want to spawn in a C++ actor
I have set the blueprint actor in header files as this -
I have initialized the same in the constructor like this -
Now, I also have defined and initialized three arrow components in my C++ Actor class like this.
What I want to know is how to add/spawn MyObstacle as a child actor on one of the above arrow components ON FUNCTION CALL, like in blueprint you have "AddChildActorComponent" Node which takes transform as one of the inputs and class as another one.
asked Nov 10 '16 at 01:10 PM in C++ Programming
Ok, nvm I found an alternate to achieve what I wanted to do. Thanks for the answers though. Cheers.
answered Nov 10 '16 at 05:38 PM
I'm not sure I did understand what you asked for, but maybe you are talking about this:
In this example, the camera will have the same transform as its parent (the root node).
Good luck. Best regards.
Follow this question
Once you sign in you will be able to subscribe for any updates here