|Topic was automatically imported from the old Question2Answer platform.
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: https://imgur.com/0wbXKtM
The TextureLoader Function: https://imgur.com/a/KQ1gNX8
Calling the TextureLoader Function: https://imgur.com/a/EWyLeuJ
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: https://imgur.com/H5eZx3o
Print Statement of TextureArray in Exported File after running TextureLoader: https://imgur.com/OXlHCDS
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 (
user://BilletController/*), and tried copying the resource folder into the same folder with the
*.pck files; yet none worked.
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.
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
Print Statement listing all files in the FileSystem Folder: https://imgur.com/bIcCZBN
Export Window with Non-Resource Call: https://imgur.com/wEazhGR
Print Statement listing all the files in the FileSystem Folder: https://imgur.com/Yt316M2
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