@TwistedTwigleg said:
Do you know what line is causing the issue?
If I had to guess based on the issue and looking at the code, I think the issue may be with lines 5 and 6. Specifically, I think the issue could be sprite_id[i]
or maybe even file_names[z]
. What I would recommend doing is printing the size of the arrays (print (sprite_id.size())
and print(file_names.size())
to make sure they have data at the indexes you are trying to access them at. I'm not sure if that is what is causing the issue, but that is where I would look first.
In the console, it writes a C++ error. So a line of code that causes this is not written. I am printing the arrays into the console and they should not be the problem.
I have taken a look on Godot's GitHub and it seems some people are getting the same error on other random occasions. https://github.com/godotengine/godot/issues/22347 So maybe a Godot bug.
Meanwhile, a switched to creating sprite nodes and probably also creating TileSets from code. So hopefully that works.
Anyways thank you for the answer!