Download

On button press, delete from one array, add to another array, but only half actually transfer across

Hi all,

So i have two arrays, one called NPC Cryosleep and another called NPC idle. On spawn all NPC actors are added to the cryosleep array, and nothing is in idle. On a UI button press, it runs the event that should get a random actor from the array inside the bounds, remove it from the Cryosleep array, add it to the idle array, and then change the colour on it. However this does not work. Sometimes 9/10 NPC in the scene will change colour, sometimes only 5/10.

Fingers crossed i’m missing something incredibly obvious here!