Dynamicly spawn TileMaps
I'm trying to dynamicly spawn tilemaps as my levels are generated procedurally. Each tilemap is a room, made in the editor, and could be spawned multiple times.
My approach right now is to create a single actor, and adding Tile map components for each room. This works fine if the generation is done within the constructor, however I need it to be dynamic, so following https://answers.unrealengine.com/questions/199144/add-components-dynamically.html I tried the following code :
The new component isn't registered upon creation, but RegisterComponent() will give a crash :
I also thought of using a single huge tilemap and copy parts of my rooms, but I'm not sure that it would be efficient.
What would be the best approach in this case ?
asked Nov 22 '15 at 04:41 PM in C++ Programming
Try passing a value to the Outer parameter of the NewObject function. That will set the owner property of the component so registration can succeed.
Follow this question
Once you sign in you will be able to subscribe for any updates here