I have a weird error where an array is empty after I did an append (on the next line after append it is still empty)
As you see in the screenshot I did some test-arrays to try to figure out what is going on, and it seems the error occur if I give my array a type (Array[Board], which is the type it should have).
If I try to append to an untyped array it works.
(Note: I tried also to type out my_nice_arr = , then append the elements, and this also worked, it got size 2. In image I show a shorter version)
The data I append is a Baord (the my_bool_arr has true in both elements), so why does Array[Board] not work?
Thanks. Im new to Godot, and did not know about the warnings and errors that are generated at runtime…
The problem was:
I was doing the fight in a worker thread and I got various errors related to “you cant do this if it is not the main thread” (was trying to update data on main thread node from the worker thread)
Not sure exactly what caused the array append error, but after cleaning up thread issues and making sure my thread is “stand alone”, and using call_deferred whenever I was updating a node in main it now works