After my timer hits 0, I go to the game over screen. When you click on game over I want to restart my game scene. But the weird thing is when I again click on play in my game scene, my timer is doubled, which means that that scene never truly restarted, I guess. The weird thing is my scene starts with 10 goes to zero, shows game over, then when I click on game over and click on taptobegin my scene starts with 40 seconds in timer. taptobegin triggers loadlevel. in menu quit button triggers quitlevel. when score is zero onclick gameover button it triggers restartlevel. Code (CSharp): using UnityEngine; using UnityEngine.SceneManagement; public class MenuScript : MonoBehaviour { public void Loadlevel() { SceneManager.LoadScene("test"); } public void QuitLevel() { Application.Quit(); } public void RestartLevel() { SceneManager.LoadScene("test"); } }
Could have to do with some object that's been set to DontDestroyOnLoad, but I would start by taking a closer look at the timer and how it gets initialized.