D
dcamod
Guest
My problem is that the AI will not stop at the correct place when at certain angles from the target and instead slide to either the left or the top depending on its angle from the target. The code seems to be recalculating a target even when it has reached its target.
Here is a video of it in action.
Code:
if object_exists(obj_Primary_goal)
{
mp_grid_path(global.grid,path,x,y,obj_Primary_goal.x+lengthdir_x(64,point_direction(obj_Primary_goal.x,obj_Primary_goal.y,x,y)),obj_Primary_goal.y+lengthdir_y(64,point_direction(obj_Primary_goal.x,obj_Primary_goal.y,x,y)),1);
tx = path_get_point_x(path,targetpos);
ty = path_get_point_y(path,targetpos);
mp_potential_step_object(tx,ty,2,obj_par_solid);
}
Last edited by a moderator: