Hey, I'm working on a game at the moment in which you construct towers and then these towers fire upon incoming enemies. All the enemies are obj_ball. I have a script which finds the distance between obj_tower and obj_ball and if it's below a variable "range" the tower fires an obj_bullet, and as game maker automatically deals with the first obj_ball created the distance measured to and the ball the bullet targets are always the first obj_ball.
Now the bit I need help with.
I want the tower to fire at whichever obj_ball is closest to it not just the first one. This means that even when the first ball is out of range the tower still does something.
Please help someone, I want this game finished quite soon.
Thanks to anyone who helps.
Alex (Onza40)