Spawn Actor in streamed-level
I dynamically spawn 3 spheres (actor-blueprints) on "event begin play". However, I want each sphere to be spawned on a different stream-level. Because the real project has not 3 spheres but more like 300.000. So I need stream-levels for performance reasons.
But there is no build-in option in the editor (that I could find) to implement this.
Adding the code to the stream-level's blueprint sadly still spawns them into the persistent level.
I tried Rama's plugin ( https://forums.unrealengine.com/showthread.php?3851-%2839%29-Rama-s-Extra-Blueprint-Nodes-for-You-as-a-Plugin-No-C-Required!&p=232851&viewfull=1#post232851 ) but it doesn't seem to work (for me) in the latest version.
Are there any other options besides C++ (which I have no knowledge of)?
It took a while to figure out how to spawn into a streamed level when using streaming levels, but after all my experimenting, it was quite easy in the end for what I was trying to achieve, so I hope this might help you out Napoleon.
I decided to switch my project over to using streaming levels, and when I tried to spawn my characters and objects, they all were spawned in the persistent level and were not visible on the streaming levels. After a bit of experimenting, here are the steps that I use to accomplish this:
1) Create a new blueprint actor (I called mine SpawnHelper) and compile it (it really has no code in it at all).
2) Drop the actor SpawnHelper into each level where I will want to spawn objects at runtime, and position them where I want to spawn.
3) Open the streaming level directly in the editor, not the persistent level that contains all your streamed levels. This could get tedious with lots of streaming levels as you will have to do steps 4 and 5 for each streaming level.
4) Select the SpawnHelper Actor in the world Outliner then right click in the Event Graph of the Level Blueprint and you can create a reference to SpawnHelper Actor. It will will show the reference as coming from persistent level, but since you are editing the streaming level directly in the editor this is fine.
5) In the Event Begin Play, use SpawnActorFromClass, and set up the pins on how you want to spawn your actors, but you must drag a pin from the SpawnHelper reference to the Owner pin on the SpawnActorFromClass function call. This will then spawn your actor in the sub level where the SpawnHelper instance is.
You can then verify that this is all working fine by opening up the main level that contains all your streaming levels and playing in the editor. If you go to the world outliner and click the little down arrow to the right of the type column you can select level. Then you can see all your spawned actors and they won't show up as being in the persistent level any more, they will actually show up as being in the right streaming levels.
My project is actually controlling the streaming levels from blueprints using LoadStreamLevel and UnloadStreamLevel, so I'm afraid I haven't tested this with distance based streaming. I'm hoping if my game world ever gets big enough eventually I'll switch the game areas to using distance based streaming, i'm just keeping things smaller for testing and proof of concept.
I had the same problem, but GRWalton you helped me solving it thank you!
Then: now I use "LoadLevelInstance" and it works totally fine. I don't even needed the SpawnHelper from GRWaltons post
answered May 31 '17 at 12:55 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here