Hello, I am trying to load a level asynchronously while leaving the current level playable still.
Here it states I can load a level while still playing the current one or show a progress bar.
when I load the level asynchronously the game pauses.
I’m using this just to test its “ability”;
private var ao : AsyncOperation;
function Update () {
if(Input.GetMouseButtonDown(0)){
Load();
}
}
function Load(){
Debug.Log("Loading");
ao = SceneManagement.SceneManager.LoadSceneAsync(2);
while(ao.progress < 0.9){
Debug.Log("WAIT");
return ;
}
Debug.Log("DONE");
}
The current level stops, and then after the new level loads the debug messages come through.
Unity docs say:
Unity will completely load all assets and all objects in the scene in a background loading thread. This allows you to load new levels while still playing the current one, show a progress bar or create a completely streaming world where you constantly load and unload different parts of the world based on the player position, without any hiccups in game play.
It’s totally wrong.