- Home /
Saving a game for the player
Ok so i am making a amaising game using unity, been using it for a while now and i would like to be able to have my player save his progress when he wants to by press escape, and there will be a GUI Box or something and a button has the word Save on it. When you hit save it will save the players data its level skill and so and so. I got this script that i am working on. Its just a test so no critisizing please.
function OnGUI () { if ( Input.GetKeyDown("esc")) { GUI.Box.enabled = true; GUI.Box (Rect(10,10,130,130), "Player Status"); if (GUI.Button (Rect(10,10,50,50), Save Progress)) { SaveGame(); } } }
function SaveGame () { SaveTo("Computer"); }
So i dont know whats wrong, just the computer part is messed up with to computer part, i want it to save it that persons computer like it does with some wooglie games how you type in a name and saves that as your name for multiplayer stuff and will automaticly save its self to the computer, but only to like save progress. But i want it to save for when you press the save progress button and it saves the data onto the hard drive, then when you go tom play the level again your score is gone but not your exp or new weapons or badges. I know there is a way to do this, so, how can i do this!
Yes, please someone answer this! I need something to use, too!
Answer by DaveA · Apr 25, 2011 at 10:10 PM
Did you try searching this forum for 'save game' ?
Thats not a answer, no but i want a direct answer thank you.
Other people have asked this wanting a direct answer. Teare has a better answer. It's hard.
Answer by Teare · Apr 25, 2011 at 11:56 PM
This is a complicated process, much more than just a simple line of code. This might help though:
http://answers.unity3d.com/questions/971/how-to-scrip-a-save-load-game-option
Your answer

Follow this Question
Related Questions
saving the game in position 1 Answer
Saving player stats for each level, static class or not ? 1 Answer
How do I quickly save a large number of variables? 5 Answers
Save scene 1 Answer
saving volume between scenes 2 Answers