- Home /
Need Help to Reset a Scene
Hi , there is probably a simple solution to this but I have been staring at my screen all day and cant find a solution to it myself. I have an endless runner type game and when the player collides with an object, the time scale is set to 0 so that the game is froze and then another scene is loaded (the 'Lose Scene'). The lose scene displays all their scores with the option to play again.
You click play again and i have scripted 'Application.LoadLevel("Main_Game");' which then brings the player back into the game which i want to be restarted but it actually just shows the player when they collided with the object and time is still frozen.
I am using static variables for the scores and i will fix them later, unless that is part of the problem? So i just want the game to be at the beginning of the level after they click play again and not in the position they died. So is there a simple solution or even a way to unload the main game once the lose scene is loaded and then simply reload main game as new ? thanks in advance !!
Answer by UNZoOM · Apr 02, 2015 at 06:40 PM
Add this
function Awake()
{
Time.timeScale = 1; // It should solve both the problems mentioned.
}
to the first script thats executed when you hit play/playAgain.
Your answer
![](https://koobas.hobune.stream/wayback/20220613192007im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Death Counter Resets When Reloading Scene. 3 Answers
Trouble with resetting the score with button 1 Answer
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Fading To New Scene Problem? 1 Answer