Using arrays, "is pending kill" error after i have removed element :/

So im trying to create a system where a varying amount of objects “orbitals” will rotate around another object “orbit tester 2”.
Orbit tester 2 has an array or orbitals.

pressing the “E” key creates a new orbital and puts it in the array.
pressing the “Q” key removes an orbital from the array and destroys it.

the event tick function goes through the array and operates their movement accordingly.

45117-desired+effect.png

visually, when running everything is fine, nothing looks out of place and the behavior seems to work well.
but, when i stop running im greeting with a whole bunch of errors regarding a “pending kill” :confused:

I cant work out how my logic has failed, is there something i should know about how arrays are handled in ue4?

At first i thought there was a problem with the logic attached to the “Q” key, but changing the order of the remove + destroy nodes just causes everything to break, and the orbitals to hang in the air and stop working :confused:

Did you happen to find a solution? I’m having a similar problem.

You should add a is valid node (Standard macro) when you try to acces something in the array. So after a get node use this macro and everything should work without any errors. :smiley: