- Home /
Save unity game play state
Hi i am trying to save my game state to my local computer by crating some short of file system that store my game state ,say i am playing brick breaker game and i have only 1 brick left to destroy and i want to destroy that last brick in next day. so what i want is a save and load button(i used gui for that) that will create a file which store the information of my whole game, where ball,brick is in the game so that when i click load it will open my window from from the position i left earlier when i was playing the game.
i have seen different type of ways to do it ,like XML serialization, mono serialization playerpref and followed a link click to see but solution provided cant load if any thing has been deleted (say i used xml serialization to save the state of my cube and during run time if i delete the cube it will not restore my cube back which it should because when i click the save button everything must be save ). thanks in advance
Answer by Drake89 · Feb 18, 2014 at 03:03 PM
player preference can save data during run time but can it store data in some location like servers or in my computer during run time
It stores it on your computer or device. You'd need another method to store data on a server.
thanks $$anonymous$$ike i m using ur plugin from asset store i want to store (position,rotation etc which ur script does for that i follow ur wizard settings ->store information it has id and all other nested codes which is difficult to understand )the location on web but for now i can store it in my pc .if it already has the stored value then it should replace the executing one(which is not a big problem),but what i can't understand is where are the file that are generated when i click save and how can i target it to store my values wherever i like .
Unity Serializer has save object to server, load object from server built in. Check out the LevelSerializer stuff - SaveObjectTreeToServer etc.
You should just have to tag up the objects you want stored - there's a lot of code, hopefully you don't need much of it.