I currently have my game setup so that everytime you die you start back at level 1. But im wanting to change it so that when you die you start back at the level you were just on. Any tips on how i could go about making that work?
if("the var you use for dying") { //load level Application.LoadLevel(1); } i think this is what you need
Thanks for posting but thats basically what I already have. I already have it set to load level 1. But what I'm looking for is for it to load the level that you were just on.
You need to do something along the lines of creating a current level variable then adding some logic to your game to load the correct level acording to that variable. You'll then need to save that variable so it persists between games. You can use PlayerPrefs to save variables to the registry or save them to a file. It all depends on how complex you need to make things.
Thats basically what i figured i would need to do. I just cant find anything in the scripting reference that I can use in the script to make the game know what level is current
What language are you scripting in? I usually have a static class called 'GameState' that contains all the information about the current game and has a save and load method in.
Ah. Im scripting in unity script. But have only been scripting for 6 months or so am still learning. I still havent really understood how to use arrays, enums and such and im not sure what exactly a class is.