Grid Graph corner inconsistency with pathing

  • A* version: 5.2.5
  • Unity version: Unity 2022.3.39f1

fully surrounded

When there are no empty space on the corners, the pathfinding updates and prevents the seeker from moving inside the blocked space and updates the seeker to a different location outside the blocked space. This works with 4 connections, 8 connections with and without cut corner.

not fully surrounded

However when there is even one space on the corner, the pathfinding doesn’t prevent the seeker from moving inside the blocked space even when i set it to update every 0.x seconds. There is a path failed error but does not stop the seeker. But once inside the blocked space, the pathfinder prevents the seeker of going outside the blocked space. This also happens with 4 connections, 8 connections with and without cut corner. The expected result should be the same as above.

What can I do to detect if the pathing fails and stop the seeker instead of it going in the blocked space. Is there also a callback when this happens? Using AILerp currently.

Can you post this error? Very odd how this is behaving

not fully surrounded

This happens in the gif when the fridge closes the path and the error still happens until the agent walks inside the close path but once inside the closed space, the path computation now completes and there’s more path failed error.

The agent does not stop moving to the set pathing when the path failed error happens and does not stop even with the auto path calculation. If I manually try to find another path inside the closed space, then the agent will stop. But what I want to happen is that once the path failure happens, the agent should stop or be notified that it should stop because of the error.

So it looks like you may be able to use the OnPathComplete callback to check that. Midway down the Searching for paths page of the documentation there’s a section where in the example callback you can check if Path.error is true, and work on that.