How to spawn a bunch of actors in DataLayer and make them visible later

Hi There

Working with World Partion and DataLayers, i try to figure out an efficient way to spawn in a bunch of actors at runtime and make them visible at a later point in the game.

I’m aware of the “hidden in Game” node but since it is a whole bunch, and varying amount of actors, this seems to be not efficient to do on every singe actor. Also, when having a parent actor, or an owning actor, toggling its visibilty has no effect to children.

When spawing the actors, i can easely bind them to an owner (sitting in the desired DataLayer), which places the actors automatically in the related Layer. Then, (SetDataLayerRuntimeState) i can toggle them (i.e. the whole Layer) between Loaded (invisible) and Activated (visible). But now, the struggle starts…

When the Owner Object is in loaded state (invisible), trying to spawn any actors with that owner reliably crashes the engine. When trying to destroy any actor, which has an Owner in loaded (invisble) state, the engine crashes reliably. While this may be somewhat expected, and probably is just a sign of missing error catching (is it activated or not?) on my side, or the engine itself, it rises the question: Is this the intended behaviour? Is it true, that we can’t spawn actors in loaded but not activated layer? How can this be achieved?

Given the above behaviour is intended, i come back to the question: what might be an efficient way to spawn in a bunch of actors to a DataLayer and make them visible at a later point in time.

Even if not exactly dedicated to the main question in this thread, i just found, that on packaged project, the “spawn actor with owner in specific DataLayer” method does not work at all. And there seems to be no possibility to add an actor to a DataLayer on runtime (there is a node for the editor, but not for production).

That raises the general question how to deal with DataLayers and dynamic content at runtime…

At least it seems DataLayers doesn’t offer any senseful capabilities to solve the initial question in packaged project.