Reputation: 13
I have a problem with restarting my level in Unity. I have a UI button that when you click it goes through this line of code:
Application.LoadLevel(1);
And for some reason none of the codes run and the scene is just frozen. Thanks in advance please help.
Upvotes: 0
Views: 80
Reputation: 166
When I want to reload my current scene, I use: Application.LoadLevel(Application.loadedLevelName);
Another way to see what index your level has in the build is, to go to File > Build Settings. In the scene list, the number at the right of the scene will show you what number to insert as a parameter into Application.LoadLevel()
.
Upvotes: 2