- Home /
Application.LoadLevel(This level) ?!??
Is there a way to call something like Application.LoadLevel but load the level currently running, basically as a way to reset the level?
Currently I am calling Application.LoadLevel("Game_Level1"), but as I add more levels I need a way to reset whatever level they are currently playing. So is there something I can put in between the parenthesis for a simple fix?
Thanks!
Answer by purplelilgirl · Sep 04, 2012 at 07:32 AM
Hi,
Application.LoadLevel(Application.loadedLevel) :) Will reset your level :)
When did this become deprecated? It's telling me to use "scene$$anonymous$$anager.LoadScene" now ins$$anonymous$$d. This must be new to 5.x because I have used this many times before. What is the purpose of the deprecating this anyone?
Answer by AlucardJay · Sep 04, 2012 at 07:38 AM
It isn't stated in the API (but I found it by searching : unity application load level the current level), you can use Application.loadedLevel to find the current level, then load that level again with :
Application.LoadLevel(Application.loadedLevel);
API :
http://docs.unity3d.com/Documentation/ScriptReference/Application.LoadLevel.html
http://docs.unity3d.com/Documentation/ScriptReference/Application-loadedLevel.html
other links :
http://answers.unity3d.com/questions/20943/how-do-you-assign-a-scene-to-applicationloadlevel.html
http://answers.unity3d.com/questions/198878/restart-current-level.html
Your answer
Follow this Question
Related Questions
Main menu script 2 Answers
LoadLevel help! 1 Answer
I am trying to play sound clip immidiately before loading new scene 3 Answers
Application.LoadLevel wrong loading of Level 1 Answer
IE Numerator & Application load level 2 Answers