Chasing bullet for nearest enemies


#1

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.


#2

These examples might give you some ideas…

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

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


#3

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


#4

Oh do you mean change target?


#5

Something like this?


#6

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