[Solved] Shoot to the nearest object

How do I…

How can I shoot to the nearest enemy (and not just a random one like in the picture below) in my top-down shooter game?

What is the expected result

The bullet should go to the nearest enemy to the player.

What is the actual result

The fire focuses on one type of enemy and keeps shooting at it.

Related screenshots

Add the condition “pick nearest object” for the Ennemis object below your inventory condition in your fire event.

1 Like

Thank you! I already searched for something similar but I didn’t realize it was a condition and not an action!

1 Like