0 votes

WRITE/READ files to/from "user://..." path unsuccessful.

Using "res://..." works fine in Godot (so the code is correct) but once it's exported to Android device, it doesn't return value. I replaced it with "user://..." as recommended, still no success. Any idea why?

Thank you for your time!

Godot version 3.2.3
in Engine by (322 points)

I'm successfully reading/writing on Android using user://savedata.txt (for example). So, I assume the problem must be in your code. Can you post the read/write code?

Thank you for your reply! I changed user://name.save to user://name.txt and it worked! The reason why I used .savewas because it said so in this link https://kidscancode.org/godot_recipes/basics/file_io/

Oddly enough .save actually worked just fine on my desktop. Anyway, problem solved, huge thanks!

By the way, where is the location of user:// in desktop? I checked "c/users/user", the saved file is not there. Must be somewhere else?

On Windows, it's here:

C:\Users\<user>\AppData\Roaming\Godot\app_userdata\<game_name>\<your_save_file>

Additionally, the difference between a .save and a .txt extension shouldn't matter at all. In fact, I just verified that my save works as expected using savedata.save...

Hmm... That's interesting. I'll try it in more android devices with .save and see if it works.

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 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 webmaster@godotengine.org with your username.