How to properly reference?

This is an example of a “Guard” manager from my shooter game, when the player is out of range, the guard calls “Repopulate” and adds itself, basically saying “Hey, I’m free”

Then when the area needs a guard, instead of spawning one, it takes that idle guard and teleports them, then removes them from the array.

(The blacked out one just spawns a new guard if the array is empty, blacked out because irrelevant)

2 Likes