I’m trying to remove values from an array. However, whenever I add something new to the array, it shows that there are still indexes for the values that were supposed to be removed.
I’ve tried using the Remove node, the Remove Index node, both the Remove and Remove Index Node together, using a clear node and then setting the array’s variable again, and getting a direct reference to the items that need to be removed and then using Remove again.
I should note that the array is contained inside of a struct, I’m not sure if that makes a difference.
It doesn’t appear that you are properly removing the indexes. At least at a glance.
As I see it you’re using two separate references for the struct.
It’s in general unwise to remove/shuffle/shift (manipulate an array) etc while in a loop.
At the start of your function create local vars for the Level Progress Cache and Level State Cache. Create A Sequence.
Then 0: Loop Level Progress Cache and store the indexes you want to remove in a Local Int Array (Indexes To Remove). On Completed, Loop the Indexes To Remove array and Remove from the Level Progress Cache local var, Clear the Indexes To Remove array.
Then 1: Do the same process for Level State Cache…reuse the Indexes To Remove array.