2.:
-Foreach Defender (event, auto every tick if in front, get first )
-Pick Defendermover by id compare Defender id (get second)
->Defender set position to DefenderMover (work with both)
3.:
-Detector is overl. Enemy (event, auto every tick if in front)
-Pick Defendermover by id compare Detector id (pick first)
-Enemy pick nearest to DefenderMover(?Detector?) (pick second)
->Defender set angle towards Enemy (work with both)
There is no need to "foreach defenders" and then "pick defenders".
You pick first and then an other, you pick second and then an other, ...., this makes no sence.
Another problem is you access for example: defendermover.ID before you pick a defendermover instance.
Or are defenders and defendermover bundled by container?
But then you can access directly, without pick.
Hope I understand right what you want...
Will be easier with project file.
How UIDs work is simple.
Every object on plattform has a unique number, always continuously.
You use it from first to bundle objects by instance varibale, yes this is one possible.
I am a fan of equality, so then i would give Defenders also instance var id...