Problem removing items from an array

Like Variss mentioned, the reason that this is not working is that the indices are all changing when you remove an item from the array. I have an easy solution to this problem, but it may not be the best: Rather than actually removing the index or the item, store the index that you would have removed anywhere inside an array of ints. Now you need to sort this array from highest value at the lowest index, and lowest value at the highest index. Now you can loop through your array of ints, and do ‘Remove Index’ on your original index at the index of the current array’s value. A better way would be to have a for each loop that counts down rather than up, but unfortunately that is not an option unless you remake a loop. The method I provided removes indices from highest to lowest, meaning that removing them won’t effect the next indices.

Edit: Since the modified for each loop option is much cheaper and much faster to do, I’ve modified it on my end, and here is a picture of the new for each loop:

I’ve highlighted all of the changes I made, hopefully I got them all. Just check the ‘Start from End’ option in your function, enjoy!

Edit: New engine versions (4.10) may overwrite your changes, so if you want, you can just create a macro library (right click in content browser -> Misc -> Macro Library), and paste this modified loop into the macro library, now you can access this new macro from anywhere, and it won’t be overwritten.