This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes


I have a global script ( loaded using AutoLoad under 'project Settings'. This script, in turn, loads a text file (data.txt) in the same project directory, the contents of which are displayed using a label node.

The problem:
Running the app on the desktop works, showing the contents of the data.txt file. However, running on a mobile device shows 'null' as the label text i.e. the global script loads but the data.txt file is not opened.

Here's part of the source code: autoloaded script:

func _ready():
    file =
    if"res://data.txt", File.READ) != 0:
        print("Error opening file")
        print("opened file") 

func get_file_content():
    var d = file.get_var()
    return d

A scene script that accesses the variables:

func _ready():
    globals = get_node("/root/globals")
    get_node("lbl_data").text = str(globals.get_file_content())
in Engine by (92 points)
edited by

1 Answer

+1 vote
Best answer

Fill filters (*.txt) at Export > [Target platform] > Resources > Filters to export

by (9,800 points)
selected by
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 Frequently asked questions and 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 [email protected] with your username.