Repath issue stuck in walls

On any grid and recast grad. If a make a big map, with walls around areas the agents navigate, it tries to plan going to unwalkable areas on the other side of the walls, and does not replan a new path. AI is just stuck on the wall, trying to reach the unreachable location.

How can i fix this?

I had similar issues. Ensure your AIPath component ‘Constrain Inside Graph’ is checked. I also found setting the ‘Pick Next Waypoint Dist’ has a big effect. Set it to 1.2. I also set the ‘Radius’ to be double of the ‘Cell Size’ in Pathfinder component Grid/Recast Graph setting.

I’m still learning, so their might be other options that can be configured, but I haven’t found them yet!