GML Enemy/Companion Obstacle Maneuvering Without Paths?

Divinik

Member
So with my enemies/companions in the game I'm making (3/4 top down), I'm trying to figure out how to have them maneuver around around walls without paths when one is between the object and the player.

The code i have now is:

Code:
if !collision_line(x,y,player.x,player.y,obj_wall,false,false)
     {
       //move towards player
     }
else
     {
       //mp path to player
     }
I was using paths to get them there, but I find them a bit buggy and inconsistent.

any alternatives to achieve this?
 

mar_cuz

Member
You could search up steering behaviours. Pixelated Pope has some information around on it. I have found it very helpful in my game for pathfinding.
 
Top