- Home /
Question by
Xcvggv · Jul 03, 2016 at 06:29 PM ·
restart game
restart a scene
Hi whenever i try to restart my scene my program simply freezes. I use :
using UnityEngine.SceneManagement;
. . .
SceneManager.LoadScene(SceneManager.GetActiveScene().name);
Can it have somthing to do with me using it during update and if yes where should i use it instead. (its an automatic restart after 5 minutes)
Comment
Best Answer
Answer by tanoshimi · Jul 03, 2016 at 06:32 PM
You're calling that in Update()? So, every frame, the scene continuously reloads itself... hence the "freezing". If you want the scene to reload after 5 minutes, use Invoke() specifying the appropriate delay.
Your answer