Pathfinding doesnt works

I made a basic maze game but ghost doesnt follows player.
it follows only when player is near to him, and some times hes doesnt colliding with walls.

I just added pathfinding behaivor to ghost and pathfinding obstacle for the walls(i dont changed any values).


What are the pathfinding obstacles, and what do their collision masks look like?

Also, where are the origin points. It helps if the origin and center points are in the center. Otherwise, the pathfinder behavior places the object with an offset because it reads one point’s location and places it at the other. This can push the destination inside a wall, causing the pathfinder to fail.

The ghost object mask should be equal or smaller than the player. The pathfinder object needs to fit completely inside the destination area and path.

Also, the basic pathfinder doesn’t calculate for rotated objects. It uses the width and height which don’t change when rotated. So, you can’t rotate copies of a wall. You need to resize it in the opposite direction.

The nav mesh pathfinder uses the hitbox. It can even be used with a tilemap object if you use the collision for the wall tiles.

1 Like

thanks for the answer its worked.i changed the size of the ghost

1 Like