Troubleshooting ProjectSettings.globalize_path - Godot 3.0.6

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


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://")
:bust_in_silhouette: Reply From: Calinou

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.

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

gp1 | 2019-02-01 00:11