Chasing bullet for nearest enemies

Hello everyone, I am creating a shooting game and I can’t figure out how to make a chasing bullet that chases the nearest enemy. Can anyone show me how? Or give an example of an event without a pathfinding objects on how to make a bullet chase the nearest enemy and when the other enemies come nearer you than that former nearest enemy, the trigger will change to that new nearest enemy.
Thank you in advance, I’ll wait for your reply.

These examples might give you some ideas…

https://editor.gdevelop-app.com/?project=example://pathfinding-basics

https://editor.gdevelop-app.com/?project=example://pathfinding

Sorry but that’s not what I am looking for. I want for my game is that for example a shooting game with a character that can shoot. It will shoot the nearest enemy and change trigger if another enemy came more nearer

Oh do you mean change target?

Something like this?

You got it! That’s it! :heart: thank you so much!

1 Like