Trouble shooting array length error:

Hi all,
Having this error kind of pop its head out of nowhere. It only gives me the error when indexing #21 of a
26 item array. Have tried recompiling all bluleprints that use this array, and deleting the variable and remaking it. No luck. Thx!

Having this error kind of pop its head
out of nowhere. It only gives me the
error when indexing #21 of a 26 item
array.

My bet is that you think the array is 26 at the time and it is not. Print its length before accessing to find out. What does it say?

You are correct! It says the length is only 20! Why? It’s declarer as 30, can you see a reason it is 20?

Do you ever remove indexes?

No, its a fixed 30 element boolean array, at start of each level it checks t/f and deletes items already picked up or disables events that have already taken place.

ok, so i was having this issue as well. i fixed it, i’m not sure what actually fixed it but, here is what i did.

-made a new “dummy” array with more than i needed
-plugged that in
-removed elements from the real array(to put it below the amount it was originally)
-played in editor
-delete game save data(this is what i FEEL did it)
-plug back in array and set correct amount of things
-made new save game data