+2 votes

I was using res:// (project's folder) to save my data but discovered that it doesn't work for android

http://docs.godotengine.org/en/stable/tutorials/step_by_step/filesystem.html?highlight=user

instead I needed to use user:// but I have no idea where it saves my data on my windows.

( same question for mac ? )

Doesn't user:// works on iOS ?

Thanks !

asked Feb 20, 2017 in Engine by leg0 (31 points)

2 Answers

+1 vote

On Windows it is saved under C:\Users\yourname\AppData\Roaming\Godot\app_userdata\yourgame

On Linux I think it's somewhere in the home folder.

I don't know about other OSes, sorry. Maybe someone else do?

answered Feb 20, 2017 by Zylann (26,967 points)

On linux is a similar location, at ~/.godot/app_userdata/yourgame

Android not sure, somewhere on a Data directory, user data partition may depend on Android version.

On Mac OSX the location is the same as on Linux: ~/.godot/app_userdata/yourgame

With Godot 3 it is ~/.local/share/godot/app_userdata on Linux.

macos Catalina /Users//Library/Application Support/Godot

+1 vote

Disclaimer, I never owned an iphone and I'm a beginner in godot, but I'll attempt to untangle this.

The docs say that user:// is just an alias for OS.get_data_dir.

For example, this is how it handles the windows platform: https://github.com/godotengine/godot/blob/master/platform/windows/os_windows.cpp#L2355

However, it's quite different for ios:
https://github.com/godotengine/godot/blob/master/platform/iphone/os_iphone.cpp#L479

String OSIPhone::get_data_dir() const {
    return data_dir;
};

At a glance, it looks like it expects a call fromset_data_dir (defined earlier in that file).

That method is not exposed to the gdscript api, it's just used internally, as evidenced here https://github.com/godotengine/godot/blob/0c80bc2579e6d3cc904f71dacde760f1081a9cb1/platform/iphone/app_delegate.mm#L123

OSIPhone::get_singleton()->set_data_dir(String::utf8([documentsDirectory UTF8String]));

Therefore I think it's safe to conclude that user:// is in the phone's documents folder.

answered Feb 20, 2017 by Daniel Mircea (79 points)
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 How to use this Q&A? before posting your first questions.