Instantiate a prefab at a certain position
I come from Unity where I instantiate a prefab like this:
Can someone help me to translate this into c++ (I know c++ but I don't know much about UE4)?
asked Feb 06 '16 at 07:42 AM in C++ Programming
The equivalent of prefabs are blueprints. I'm assuming you have a blueprint that is responsible for the spawn which is based on a c++ class. Inside the header file of your c++ class, add the following property:
Then, don't forget to compile and switch to your editor and "link" the YourActorBP with the blueprint you want.
After that, somewhere in your logic (.cpp file) type in:
Spawn Parameters provide some useful functionality when spawning. Of course, you can create a transform you want and replace the second property I've provided above. There are some other overloads for the SpawnActor function, all of them can be found here
Follow this question
Once you sign in you will be able to subscribe for any updates here