0 votes

Hello,

I have a test project with one scene, one Node2D with a script attached to it and a Label.

This "ProjectSettings.globalize_path("res://")" returns nothing when the project is exported to a mac or windows 7 or android S9 but works fine when project run in the editor.

Can "ProjectSettings.globalize_path" be used when the project is exported?

The script:

extends Node2D

func _ready():
    $lbl.text = ProjectSettings.globalize_path("res://")
in Engine by (56 points)

1 Answer

+1 vote
Best answer

Using ProjectSettings.globalize_path() on a res:// path probably doesn't make sense in exported projects, since all files located in res:// are present in the PCK file (which is a virtual filesystem). Remember that you shouldn't assume res:// to be writable to in exported projects, especially on mobile platforms.

However, it should work fine on user:// paths, even in exported projects.

by (10,914 points)
selected by

Thank you for your time and clarification!

I was using ProjectSettings.globalize_path("res://") to troubleshoot my real issue which was loading an image located under "res://" for image manipulation.

So, I thought that it would be better and cleaner to make a brand-new question:

Image manipulation, picture located under "res://" can't be loaded when the project is exported

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.