How to store player progress

Hi guys,
This is john , i was following unity 2d course and suddenly thought of how to save the player progress for future reference, like if i collect a coin and killed the game i want my game to remember total points next time i open the game , something like high score…
how to do that in unity ,is there any build in database like thingy ,

I’m particularly interested in understanding the most efficient and reliable methods for saving and loading player data, such as progress, preferences, and customization options.

thank you,

There isn’t really a built-in way. You can use PlayerPrefs but that’s not really made for saving a game save. More for saving things like ‘was the music muted’, etc. If it’s going to be something simple like storing the player’s high score, PlayerPrefs could be sufficient.

A proper saving system is quite involved. The RPG course covers a full saving system. It’s generic, so it can be used for any game. It has some drawbacks because it uses a binary formatter that has since been deemed unsafe by Microsoft. However, @Brian_Trotter has written a whole thing on converting the binary bits to json instead. Still the same system, just saves as json instead of using the (now unsafe) binary formatter. You can find info here: Saving System Upgrade: Replacing BinaryFormatter with Json.NET

I was thinking the same thing. a save system would work but you really don’t want to save every time you move or collect so perhaps an autosave every x seconds or at a given milestone.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms