How Can I Open Previous Scene? (168575)

Opening “Dead Scene” when player is dead. And there is again button in “Dead Scene”. If player click it, i want to open scene again.
I have an idea but it is useless.

If you know best or easiest way to do this. Can you tell me?

Thank you.

1 Answer

1

Make a variable that keeps track of the scene, update the variable when switching scenes.

public static string PreviousScene = "";

public void LoadScene(string sceneName)
{
    PreviousScene = SceneManager.GetActiveScene().name;
    SceneManager.LoadScene(sceneName);
}

Thank you this is what i need to know exactly.

No, the transform values in the editor stay the same.