GML How would i have an enemy pathfind around multiple objects?

SirCaliber

Member
I have this in the step event for the enemy:
Code:
grid=mp_grid_create(0,0,room_width/32,room_height/32,32,32)
path=path_add()
mp_grid_add_instances(grid,oBarrel,0)
mp_grid_add_instances(grid,oWall,0)

mp_grid_path(grid,path,x,y,oPlayer.x,oPlayer.y,1)
path_start(path,thisSpeed,show_debug_message("end"),1)
They'll pathfind around the barrel fine, but they'll just go right through the wall. Sometimes they'll pathfind around the short part of the wall. This is a game breaking bug and I need as much help as I can get. Thanks!

Edit: I think i just found the problem... The collision mask wasn't set up properly!
 
Last edited:
Top