SOLVED Objects using mp_grid_path are passing through parts of the objects they should be avoiding

Hey guys,

Title says it all. I am trying to move some characters using a grid but the path is not calculated as well as it should be and the characters end up passing through parts of the obstacles they should be avoiding. Makes everything look fake.

This is the code. Standard stuff, used it before and it worked fine. Everything is marked as solid, collision masks are ok and everything snaps to a 64 grid.

GML:
var mx = (xx div 64) * 64;
var my = (yy div 64) * 64;

if (mp_grid_path (global.grid, path, x,y,mx,my,0))
    {path_start(path, movementSpeed, path_action_stop, false);}
If I use mp_potential_path instead everything is crisp, but this is not an option for me as I plan to have a relatively large number of characters on screen and this method uses a lot of resources.

Again the code for this alternative:

GML:
var mx = (xx div 64) * 64;
var my = (yy div 64) * 64;

mp_potential_path(path, mx,my,2,4,false);
path_start(path,2,path_action_stop,true);
 
Top