- Home /
Save level
How Save Level when Playing and then load (using PlayerPrefs)?
Answer by ad48 · Aug 05, 2011 at 07:25 AM
please, move your questions into the Comment section below the answer you are commenting on.
Answer by ad48 · Aug 05, 2011 at 07:07 AM
What is PlayerPrefs.Save
dont qustion in the answer comment in others answer to comment on his answer
Answer by BerggreenDK · Aug 05, 2011 at 01:10 AM
First of all, you'll need some way to access all the data you need to save.
If you create a GameData class and put every variable inside this one, it might be a little easier to use.
Secondly you need to program 2 functions, as you mention, a LoadGame() and a SaveGame()
These two functions will then either:
Grab data from PlayerPrefs and store it inside the GameData variables. or Grab data from the GameData variables and store them in PlayerPrefs.
PlayerPrefs
http://unity3d.com/support/documentation/ScriptReference/PlayerPrefs.html
You have to use these functions to GET or SET the values from your code.
Whats in your GameData class, I dont know as you havent shown us any code.
(note: I find your question rather general and with too little details, but I have tried to provide something usefull anyhow)
Lastly, SEARCH in the upper right corner also works:
http://answers.unity3d.com/questions/17873/saveload-playerprefs.html
Your answer
![](https://koobas.hobune.stream/wayback/20220612170436im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
PlayerPrefs Help 1 Answer
Playerprefs and collecting currency 1 Answer
Load NSUserDefaults from previous Android app. 0 Answers
Save Values On Closing of Game 1 Answer