Pathfinding doesn't work correctly

i added enemies with pathfinding behaviour that follows the player, and object (door) that toggles it’s pathfinding obstacle behaviour when clicked, but enemies while going throught it can go through specific doors when they’re blocked or stuck in them, ignoring if they’re blocked or not


Make sure the doors aren’t rotated. Adjust the size of the object instead of rotating a door facing in another direction.

There’s a bug in the official pathfinder behavior. It checks the width and height of obstacles but those values don’t change when an object is rotated. So, it plots a path as if the object isn’t rotated.

The nav mesh behavior doesn’t have this issue. It also uses the collision mask instead of the overall size. It has it’s own obstacle behavior.

You can either make sure the objects aren’t rotated or use nav mesh.

doors aren’t rotated

I’m testing it and see what you’re saying. It happens to me as well even if I update the move position in each frame. I’ll keep playing with it and reply if I find anything.

I can’t get it to work with the builtin pathfinder. IDK if there’s a delay or something.

I replaced the builtin pathfinder movement and obstacle behaviors with nav mesh and it seems flawless.

The actions are different. So, you need to modify the movement action to use the nav mesh action.

Edit: I don’t like nav mesh. I haven’t used it much. I my tests, it was getting stuck on corners.

I think I found a fix. After the move action check if there’s a path. If there’s not a path then stop the object or give it a new target. Maybe switch it to patrol mode.

This works.

I still think it’s a bug and should probably be reported. Although maybe it’s because if there’s no path found then it doesn’t change its destination. So, if it’s already moving it doesn’t get updated.

Before this I tried everything. I toggled between passable and not passable and I even moved the door instead of adjust it’s settings. It kept going through the door.