• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

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