Move player toward nearest enemy

A lil problem here
I can’t figure out how to make my player object know which enemy object is the nearest. It’s in a top down game.

the “pick nearest object” isn’t do what you want?

Gonna try that.
But i am afraid that a bunch of allys searching for nearest enemys and enemys searching for nearest allys at the same time will be very performance consuming.

you asked:

usually there is one player per game. how could I have known?

My bad sorry.i shoud have say i have multiple allys fighting multiple enemys

1 Like