How to save a game

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By loloid


I’m making a game in gdscript in which i made a save system that work like this :

const filepath = "res://save/"
func load_list():
	var file =
	if not file.file_exists(filepath): return, File.READ)
	saved_list = file.get_var()

func save_list():
	var file =, File.WRITE)

In my file, i store a list of array. This code seems to work if i use it in the engine. But when i’m exporting my game, it doesn’t work anymore. I can use the array that i did in the engine, when i use “save_list()” it works when i’m in the game but as soon as i close the game, “” return as when i exported the game.

I’m sorry if i’m not clear, i’m not native English speaker so i hope you’ll understand.


:bust_in_silhouette: Reply From: player0815

iam not sure but i suspect you have to use “user://[filepath]” as path, because thats the only place where you have writing access

than in windows you find this file in %appdata%/godot/[your_project]/