Noob needs help

M

Maxikit2803

Guest
hey, im doing a action RPG right now and i dont know how to do this:
i have 7 linear paths next to each other and what i want is that as soon as an enemy spawns, he runs toward the nearest path and follows it. how to do dis?
 
You can loop through all the points on all the paths and find the nearest one to the enemy using point_distance().

Or more simply, could you not just randomly choose which path you want the enemy to follow as the first step, then spawn the enemy near that path. Then you already know which path the enemy needs follow.
 
Top