Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question NavMesh.CalculatePath destination are different to the last corner position

Discussion in 'Navigation' started by Lonlindil, Jan 24, 2021.

  1. Lonlindil

    Lonlindil

    Joined:
    Dec 15, 2020
    Posts:
    1
    Hello,

    i have some interrogation from CalculatePath, in my case, the path return complete but the destination are not reach by the pathfinding.

    for exemple this code

    Code (CSharp):
    1.         NavMesh.CalculatePath(_car.gameObject.transform.position, BestDest, NavMesh.AllAreas, path);
    2.         Debug.Log("Path : "+ path.status + BestDest+ path.corners[path.corners.Length - 1]);
    return this log :
    Path : PathComplete(6.5, 18.5, 13.0)(6.5, 19.5, 13.0)


    i dont understand why BestDest : Vector3(6.5, 18.5, 13.0) can be different to the last corner position (6.5, 19.5, 13.0)

    can you help me for understand this function?

    thanks.
    Dragondark De Lonlindil