Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

NavMeshPathStatus.PathComplete but 0 corners?

Discussion in 'Navigation' started by svenneve, Jul 17, 2015.

  1. svenneve


    May 14, 2013
    I'm just trying to wrap my head around this, and i'm not sure this is a bug, or 'by design'.

    But when we calculate a navmesh and get the NavMeshPathStatus, it will often return PathComplete, but have a length of 0 corners, which in my opinion should return NavMeshPathStatus.PathInvalid.

    Now the workaround is easy, but it does require checking for both the status and the corner length, which can't be good performance wise (though debatable is of course whether or not his would even measure in the whole navigation logic of our script given that a navmesh path calculation is already rather heavy performance wise.)
  2. Immanuel-Scholz


    Jun 8, 2013
    If you are only concerned about performance, then think about this: How would Unity implement your request? That's right. They would probably just move your current length-test into their function and set the NavMeshPathStatus accordingly to the length==0. Nothing gained (but most probably nothing lost).

    If you are concerned about the beauty of the interface, just write a wrapper around it or define an extension method. ;)