Search Unity

Scene changes causing previous scenes to be blocked

Discussion in 'Scripting' started by MaciejKusztal, Sep 12, 2020.

?

Why is early ending the game causing an error?

  1. Moving correctly around the stage, without any mistakes.

    1 vote(s)
    100.0%
  2. Moving correctly around the stage, without any mistakes.

    0 vote(s)
    0.0%
Multiple votes are allowed.
  1. MaciejKusztal

    MaciejKusztal

    Joined:
    Feb 4, 2020
    Posts:
    87
    Let's assume I have 2 MainMenu scenes (1) and Game (2). The moment I go from scene 1 to 2. Everything is fine, however, when the 'Pause' options are pressed in the game and I return to scene 1- the particle system, which is usually on, does not work. Moving on, since this system is turned off, I turn on the game again - and the game is stopped. The countdown to the start of the game will not activate. Why is early ending the game causing an error?

    Code (CSharp):
    1. public void LoadMainMenu()
    2.     {
    3.         SceneManager.LoadScene("MainMenu", LoadSceneMode.Single);
    4.     }
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,752
    Are you leaving Time.timeScale set to zero after quitting from pause?

    You can trivially see this: run your game, cause the problem, then go into the TimeManager. Does it say zero or 1?
     
  3. MaciejKusztal

    MaciejKusztal

    Joined:
    Feb 4, 2020
    Posts:
    87
    That was it !. Great. Thank you :).
     
    Kurt-Dekker likes this.