So i know that to load levels you need to go to the build settings and that but rather than putting in that number many times for each level would it be possible to use one script that says to load the level right above it, or to reload the same level?
I couldn’t find anything in the scripting refrence.
If you are asking if you can avoid, going to build settings and adding current level, in order to load in game. I think no.
ussualy u would go
Application.LoadLevel (“1”);
for the next level
Application.LoadLevel (“2”);
Application.LoadLevel (“3”);
and so on
what i want to do is have one script that says load the level right above it
so if its on lvl 1 then go to 2 then 3 and so on
Sure, why not. Just use PlayerPrefs. Or a static var int.
ok so how would this be used the scripting refrence area was cluttered with everything but loading scenes
So you want to know how to go from level 2 to 1? and 2 but reload and start over?
I’m not sure but to go back a level I think you could do something like:
int lastLevel = Application.loadedLevel--;
Application.LoadLevel(lastLevel);
(not tested)
You would want to put a check to make sure they aren’t on level 0. I think for reloading the level you can just have it load the current level over again, I’m honestly not entirely sure.
Reference: