Loading level before player?

Hi Limp_Noodle

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.

  1. Placeholder room.
    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.

  2. 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).

Alex

1 Like