Making a Game Save hitting a trigger
I'm making a game with levels,when the player hits the finish trigger a "Win" panel appear.How can i make my game saving and the 2 level (and when it's finished 3-4-5 ecc..) unlocking? (sorry for bad english)
Comment
Answer by Cow-Necromancer · Oct 01, 2015 at 10:05 AM
If you are talking about what level you are up to and saving it PlayerPrefs will help //Setting a playerPrefs
PlayerPrefs.SetInt("Level", 2)
//Getting a playerprefs
PlayerPrefs.GetInt("Level")
//This is how you can use it
if(PlayerPrefs.GetInt("Level") < 3)
print("You cannot access this level");
else
print ("You can access this level");
I tried to make it very simple, and there may be errors. If you want more help this link may help: Player Prefs