Issue with Exporting Non-Resource Files

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

I’m a bit new to Godot, so please excuse my ignorance if the solution is rather simple, but I’ve created a program where one of the features changes the texture of a Polygon2D node by pulling from an array of textures. This array is built by looping through a specific FileSystem folder and appending each *.png into the array variable.

FileSystem Folder:
The FileSystem Folder Scheme

The TextureLoader Function:
The TextureLoaderCode

Calling the TextureLoader Function:
TextureLoader Function in ready()

When running this in the Editor, the texture array is created and works properly; however when exported, it looks like the program has trouble finding the folders because the texture array remains empty.

Print Statement of TextureArray in Editor after running TextureLoader:
Editor Print Statement

Print Statement of TextureArray in Exported File after running TextureLoader:
Exported Print Statement

I’ve looked into this issue and found other folks had a similar problem, solving it through explicitly calling the files/folders in the Resources tab on the Export Window. Yet I’ve tried calling the files (*.png), calling the directory (BilletController/*, res://BilletController/*, & user://BilletController/*), and tried copying the resource folder into the same folder with the *.exe & *.pck files; yet none worked.

My References:

With all that being said…

…am I missing something? Through my research, I saw some mention of a ResourceLoader, would that play a part in this? Any advice would be appreciated.
(_ _;:wink:

On further inspection, I confirmed that the *.png files weren’t actually being exported and only the *.png.import files, even when I explicitly called the file type and the folder within the Export window:

Print Statement listing all files in the FileSystem Folder:
enter image description here

Export Window with Non-Resource Call:
Export Window

Print Statement listing all the files in the FileSystem Folder:
Print Statement Exported List

Wouldn’t it be easier to put all images into one big sprite sheet and then using it as texture in a sprite node?

juppi | 2021-12-03 16:01