- Home /
How to Add more than 2 levels?
After I do the int currentLvl=0; Application.LoadLevel(currentLvl +1); It does change the scene but it neve loads the third part coz somehow the currentLvl remains to zero...
The object that 'currentLvl' is attached to sounds like it does not have DontDestroyOnLoad; show the relevant parts of the code level mgmt script
Answer by JasonBricco · Mar 26, 2014 at 03:21 AM
If you use Application.LoadLevel(currentLvl + 1) it will load the scene with index 1, but it doesn't change the 'currentLvl' variable. You would have to change that after the level loads.
You can use Application.loadedLevel as well, which will always be the index of the level loaded.
Answer by Sildaekar · Mar 26, 2014 at 03:21 AM
You have to increment the "currentLvl" variable. If you initialize it at 0 and then never change it, it will always be 0.
Answer by Swaminathan · Mar 26, 2014 at 08:21 AM
First check whether all the scenes were included in the build settings.
then use Application.Loadlevel ("enter your scene name")
Hope This method may help you ..
any doubt just comment me ... thank you ..