I would make sure the object origin point is in the center.
And to be safe make sure there’s no extra space in the image because the pathfinder uses the overall size (bounding box) and not the collision mask.
The left is better.
Also, make sure the target object isn’t inside the wall. You could alway use separate the target from the wall.
Make sure the obstacles aren’t rotated. The angle should be 0. The pathfinder doesn’t adjust for the angle.
Here is an extreme example. It added 100 pairs of objects. A player and a target. 96 found a path and 4 did not find a path.
The smaller object is the player and the larger is the target. The objects with a straight red line are the objects that failed. The red line is not the path. It is just a straight line to highlight which player is linked to which target.
The paths that failed all seem to have a target that is too close to a wall. Maybe, if the target was farther away from the wall.
The walls on the bottom are rotated copies of the walls on the top. You can see how the pathfinder ignored the walls and made a path through them.
The pathfinder isn’t perfect. Make sure the other tips are tried. Alwaya check if a path is found and if it’s not then try again.
For anyone curious of how I tested this. Here are the events. I used player and player2 for the target. The text object has a default value of 0 so I didn’t need a variable.
Edit: I was doing some more testing to try and figure out why some of my paths were failing.
It might sound confusing but as I said, the bottom 3 walls were rotated instead of resized. So, the pathfinder sees the walls as if they weren’t rotated.
The grey blocks represent where the walls would be if they weren’t rotated. While I was separating the target object from the wall, it wasn’t being separated from the position that the pathfinder uses. So, the pathfinder still thinks the path is blocked.
The main thing that this proves is that. Obstacles shouldn’t be rotated. The behavior uses the width and height of the obstacle. When rotated, the width and height doesn’t change. The behavior probably should use the bounding box.