Legacy GM Path finding odd isue

R

Rodimus

Guest
Hello I made a global var, and assign to it an mp_grid. It's working fine, but for an unknow reason the first created instance what using the path not start moving. I checked the path length and it says -1 at the first unmoving instance. I'll show what i'v done:

object 1:

Create Event:
globalvar roomgrid;
roomgrid = mp_grid_create(0,0,room_width/32,room_height/32,32,32);
mp_grid_add_instances(roomgrid,o_wall,false);
color=choose(c_red,c_blue,c_aqua,c_lime,c_yellow);
alarm[0] = 200;
Alarm 0:
e=instance_create(x+32,y,other_object);
e.color = color;

with (e)
{
path = path_add();
path = mp_grid_path(roomgrid,path,x,y,o_base.x,o_base.y,false);
path_start(path,2,path_action_stop,false);
}
alarm[0] = 60;

Why the first spawned instance not do anything? The other works perfectly!
 
Last edited by a moderator:
R

Rodimus

Guest
Top