0

I need to execute these first 2 lines (the timeScale and the Text), but I want to add a delay so after like 2 seconds The Scene Starts Over. Ty

   // called when the player answers all the problems
    void Win ()
    {
        Time.timeScale = 1f;
        UI.instance.SetEndText(true);
        SceneManager.LoadScene("Game");

    }

    // called if the remaining time on a problem reaches 0
    void Lose ()
    {
        Time.timeScale = 1f;
        UI.instance.SetEndText(false);
        SceneManager.LoadScene("Game");
    }
derHugo
  • 83,094
  • 9
  • 75
  • 115
  • Does this answer your question? [How to make the script wait/sleep in a simple way in unity](https://stackoverflow.com/questions/30056471/how-to-make-the-script-wait-sleep-in-a-simple-way-in-unity) – derHugo May 21 '21 at 20:30
  • Please use the correct tags! `unityscript` is or better was a JavaScript flavor like custom language used in early Unity versions and is long deprecated by now! Also just because you are using a certain IDE doesn't mean that this question is about that IDE. – derHugo May 21 '21 at 20:31

1 Answers1

-1

this should give you delay of 2 sec. just put it where oyu like it in the function

System.Threading.Thread.Sleep(2);