This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
+1 vote

I am making a saving system, but I can save but not read, I don’t know where the problem is. Below is my code。

I made a scene where I used the button to directly reference the read function, and then everything became very strange, I couldn’t control my character

func savegame():
var save
game ="user://", File.WRITE)
var persistingNodes = get
for node in persistingNodes:
var node
data =

func loadgame():
var save
game =
if not savegame.fileexists("user://"):

var persistingNodes = get_tree().get_nodes_in_group("Persists")
for node in persistingNodes:
    node.queue_free()"user://", File.READ)
while not save_game.eof_reached():
    var current_line = parse_json(save_game.get_line())
    if current_line != null:
        var newNode = load(current_line["filename"]).instance()
        get_node(current_line["parent"]).add_child(newNode, true)
        for property in current_line.keys():
            if (property == "filename"
            or property == "parent"
            or property == "gold"):
            newNode.set(property, current_line[property])

I want to make a shop system to buy characters, hope someone can help,

Godot version 3.3
in Engine by (13 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.