Is there any way to delay the player spawning into a streamed level or at least make sure the level is fully loaded before the player is spawned? I have a huge world that I am using world composition. My main menu is a different level altogether. Going from the main menu (where the player can start a new game or go to their last save) to the play world results in the player falling while the level loads meshes and landscapes. Loading screens on the marketplace like Ascync are not designed for world composition. Does anyone know how to prevent the player from being spawned first or delaying it until the level is loaded?
I had this problem with streaming. I found the best thing is to wait until you can see the player start ( I put one in the level just for this ), and then spawn the player. I do the wait like this:
I tried that. Unfortunately it didn’t work.
There isn’t an official way to detect when the level is loaded as it’s handled asynchronously by the engine. Basically, the game thread cannot tell what has been loaded around it.
There are a couple of things you could try.
Have a small unlit room somewhere undeath your level which will hold the spawned player for x amount of time before moving the pawn to the correct position in the world. A bit like purgatory for the player until the world has finished loading. Assassins Creed (along with other titles) make great use of systems like this.
World call back system.
You can make it so the pawn does not spawn automatically and manually spawn and possess the pawn when you’re ready. If you have actors in the world that you know must be loaded, you can create a call back system with the GameMode. For example, once each actor has initialized on BeginPlay, they cast to the GameMode and let the GameMode know that it’s ready, once the GameMode has had responses from all actors in the scene, then call to spawn the pawn.
There are pros and cons to both solutions.
Hope this helps (or at least provides food for thought).
Ok, got it partly working how I want, just got to figure out how to make work if it’s a multiplayer game. Thanks
I technically have it working for multiplayer, but would you be able to take a look at my code here and see if you know why I am getting an error when I stop the game
How Do I Spawn Character for Multiplayer Level Streaming - Programming & Scripting / Blueprint - Unreal Engine Forums