reachedEndOfPath / reachedDestination Inaccuracy in 2D Due to Height Check?

  • A* version: 5.3.6
  • Unity version: 2022.3
    I’m using the A* Pathfinding Project in a 2D Unity game, and I noticed that sometimes reachedEndOfPath or reachedDestination doesn’t return true, even though the agent is visually at the destination.

From the documentation, it seems the end-of-path check includes a vertical condition (not above the head or too far below the feet). Since this makes sense in 3D, I’m wondering if it could cause false negatives in 2D games where movement is strictly on the X/Y plane.

Is there a recommended way to disable or work around this height-based check for 2D usage? Or is manually checking distance the best workaround?

Hi

I would prefer to keep this in. It makes for a much more consistent code-base. But I will consider it. Right now, the agent doesn’t even know that it is just moving in a 2D plane, it is equivalent to moving on a rotated graph.

Since the agent is moving on the XY plane, setting the destination to the XY plane too will make everything work as you wish.