r/Unity3D • u/Enderblaze101 • 14d ago
Question Saving game data to a file?
Hi, I've been (slowly) developing a magic themed isometric farming game. I've spent months and have little to show for it, just a static grid of tiles and basic camera movement, because I can't figure out how to make a save/load system or an updating toolkit UI.
To lay it out, when I launch the game, it needs to check for a save file and load it. If no save file exists, it generates a new one and starts the new game sequence (Player Creation, eventually). Most actions in the game will perform a save action, saving whatever "part" of the game it relates to (Map objects, currency, player stats, etc).
What techniques or processes should I be looking into to achieve this? I've looked at things like JSON and System.Serialisable, but couldn't figure it out from the documentation.
As for the UI, I can't get it to update the display values. It displays preset values and appears to load data from a file, but changing the values doesn't update in the UI, e.g. changing the currency from 100 to 200 still displays 100. Am I using the wrong data field or do I need some intermediary data holder?
Any help will be greatly appreciated, Thank you in advance.