[QUOTE=Ashley] Picking the nearest object would slow down games a lot - instead of taking the first picked (which seems to you to be random), it would have to check every single instance measuring its distance. If you have 100 object instances, that's 100 times as much work, and it affects every single condition!

You can add a for-each loop yourself to test each individual instance's distance. I'll see if I can add a 'pick closest' for the next build.[/QUOTE]

Damn iterations!! An idea I might use is to have some kind of list/array of all specified objects and an associated distance to whatever target then use min(a,b,c...) to find the the smallest distance or max(a,b,c...) to find the largest distance or maybe an array/list which sorts itself as objects are added from smallest to highest then you can pick the first for nearest and last for furthest. Each has its pros and cons but there's a few ways to do it whilst trying to keep away from the iterations...

I tend to think of the most complicated way of doing something so there's probably simpler methods.