0
votes

I have been using the Godot Engine for a month or two and I am almost finished with my first game. I want to figure out how to save my characters location, stats etc, and use them when the player opens the game again. I am using GDscript and Godot Engine 3.2.

1

1 Answers

0
votes

Godot has some built-in functionality for JSON persistence. https://docs.godotengine.org/en/stable/tutorials/io/saving_games.html

Determine which nodes need their state saved. In the editor add them to a custom group, "Persist", or whatever you want to call it.

In your save function (most likely in a singleton), loop through all nodes in the Persist group and grab the values you need off of them.

The rest of the guide walks you through converting to and from JSON and reading/writing to the file system.