How to spawn blueprint object from c++
Hello, everyone. Here is my problem: I created a c++ class floorCell then used this calss as a parent class for blueprint. add static mesh and a few other things. Also I have a gameMode c++ class which have spawn() function. So I want to spawn floorCells from this function. What should I do. If I just use SpawnActor with floorCell parameter it is of course spawned but without any mesh. Thank you.
asked Dec 24 '15 at 08:23 AM in C++ Programming
You want to spawn the blueprint in c++ ? You need to import the blueprint class. Add a variable to your class, something like:
Then import the blueprint in the constructor:
You can get the reference by right clicking on your bp and doing 'copy reference'. Note the _C near the end which is added on.
Then, in your spawn function, you do this:
answered Dec 24 '15 at 09:43 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here