Question by
bblakeyyy · Aug 21, 2019 at 10:30 AM ·
movementpause menuscene loadpause game
Cannot move after switching scenes?
If i go from my main menu to my game, it works fine, but if i go from a level to quitting back to main menu, and then back into a level, movement does not work unless i pause and unpause the game. HELP!
here's my script for the start button using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement;
public class StartButton : MonoBehaviour { public void StartGame() { SceneManager.LoadScene(1); }
}
I also have script for the continue button. using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement;
public class ContinueButton : MonoBehaviour { private int sceneToContinue;
public void ContinueGame()
{
sceneToContinue = PlayerPrefs.GetInt("SavedScene");
if (sceneToContinue != 0)
SceneManager.LoadScene(sceneToContinue);
else
return;
}
}
Comment