I’m trying to create a smooth loading screen for moving from scene to scene using
public IEnumerator LoadScene()
{
//Start loading next scene
asyncOperation = SceneManager.LoadSceneAsync(levelToLoadName);
asyncOperation.allowSceneActivation = false;
yield return asyncOperation;
}
void Update ()
{
if(asyncOperation.isDone || asyncOperation.progress >= 0.9f)
{
asyncOperation.allowSceneActivation = true;
}
I’m getting a long lag/pause on the loading screen as soon as allowSceneActivation is set to true, which I believe is from all the Awake() and Start() functions being called in the new scene (using quite a large project).
Problem is, how do I get around this? I can’t call any function on a scene that is still not loaded.
I’ve tested the loading transition with a scene that has no MonoBehaviours in it and can confirm this is happening due to the Awake/Start calls.
Any ideas?