This is the code I'm using to test saving in my game. I have tried it, but it does not work. What can I do to fix it? I get no errors or anything, so I don't know what is wrong.
var gamedata = {
"coins": coins
}
func savegame():
var save = File.new()
save.open("user://savegame.sav", File.WRITE)
save.storeline(tojson(gamedata))
save.close()
func loadsavefile():
var save = File.new()
save.open("user://savegame.sav", File.READ)
var text = save.getastext()
gamedata = parse_json(text)
save.close()