
I'm building a simple character creator.
The character is its own scene, with each customizable part being a sprite with a script attached. In the script I have a function which imports all files in a given path, and stores the files in an array - so for example the hair:
get_files("res://4_Hair/braids")
The directory contains a around 5-6 png files with different color variations of the hair. File 1 is array[0]
, file 2 is array[1]
, and so on.
I then have a button in the main scene which will increment the array index by one, and apply the texture. (it loops back to 0 if it goes too far).
This works well when I run the project from the editor, however if I run the exported exe, the files are not imported and the array will be empty, throwing the error in the screenshot. I've tried exporting all files in the project but I still have the same issue.
Any idea whats going on here?