Rivo
7014
I'm using the built in A* algorithm to make the enemy follow the player
The enemy is currently in attack mode, and I want him to shoot from a distance. So I have created a little radius that the enemy has to stop on so it doesn't get to close, or else there will be no 'shooting from distance' lol
Here is the code.
The enemy just keeps following the player and I don't really understand why. Any solutions? Any help at all would great thanks.
The enemy is currently in attack mode, and I want him to shoot from a distance. So I have created a little radius that the enemy has to stop on so it doesn't get to close, or else there will be no 'shooting from distance' lol
Here is the code.
Code:
if !distance_to_object(oPlayer) <= radius{
if mp_grid_path(pathfinder_grid, path, x, y, oPlayer.x, oPlayer.y, true){
path_start(path, spd, path_action_stop, false);
}
}