Scene is not loading

My Game Over Scene works fine in my Game Window when I press play. But when I load it from another level it switches back and forth from “normal” to “(not loaded)”. I have added the Scene to my Build Settings and tried loading it with the name as well as the index.
This is the code where I load the scene if it helps:

 void FixedUpdate()
    {
        if (gamehealth == 0)
        {
            SceneManager.LoadScene(6);
        }
    }

Thank you for your help!

Did you try the options described here: Unity - Scripting API: SceneManagement.SceneManager.LoadScene?

yes and when I did this with the other Scenes it worked perfectly.

I wouldn’t load it from FixedUpdate like that. FixedUpdate can be called multiple times before your scene is actually loaded. FixedUpdate is for making physics calculations just prior to the physics update. Don’t use it for other things.

1 Like