Finding the closest

Blitz3D Forums/Blitz3D Programming/Finding the closest

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

ok I'm not completely sure how to explain tis buti'm gonna try...

I am making a 3D pong game.
I added powerups
One of the powerups creates a new ball
When there are to many balls the computer paddle can't figure out the right one to follow

I want it to follow the closest one to it.
How do i find the closest one of a bunch of types?(Or the biggest, fastest, slowest, farthest, etc....)