- Home /
Anyway to save which seen the player was on, then load that scene back from another one at a different time?
I need unity to remember which scene i was playing before i quit, and then load it back hen i run the game again from a different scene- how do I do this?
Answer by chief1234 · Oct 20, 2010 at 10:42 PM
Have a look at the PlayerPrefs class - http://unity3d.com/support/documentation/ScriptReference/PlayerPrefs.SetInt.html
something like this should do the trick:
Set the player level when a new scene is loaded to save the number of the last level to be loaded on the player's machine:
PlayerPrefs.SetInt("SaveLevel", Application.loadedLevel);
And call this when the game is first started to get that same value:
savedLevel = PlayerPrefs.GetInt("SaveLevel"));
Glad I could help - please check the question as answered :)
Your answer
Follow this Question
Related Questions
checkpoint level please 2 Answers
How can I save the player's progress in-game? 1 Answer
Application load advanced loading NO EXPERIENCE 2 Answers
Saving score to next level? 3 Answers
Loading Scene on a series of events 2 Answers