Search Unity

  1. We would like to hear your feedback about Unity and our products. Click here for more information.
    Dismiss Notice

NavMesh.CalculatePath return value

Discussion in 'Documentation' started by Baste, May 11, 2015.

  1. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    3,875
    Hi!

    The API page for NavMesh.CalculatePath states that the return value is "True if a path is found".

    This doesn't really tell the whole story. CalculatePath returns true as long as it can find a partial path - so if the created path's status is "PathPartial", you still get a true return value.

    This has confused me a couple of times, and I have seen some questions over on Answers about this. After all, if you don't have a complete path, you can't reach the destination.

    I think somethink like this would be a clearer documentation:

    Returns
    bool True if a path (Complete or Partial) is found.
     
  2. andeeeee

    andeeeee

    Joined:
    Jul 19, 2005
    Posts:
    8,768
    Hi. Thanks for the report!

    I've updated the docs following your suggestion and you should see the change in the near future.
     
  3. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    3,875
    Thank you for the quick response!
     
  4. Alan-Liu

    Alan-Liu

    Joined:
    Jan 23, 2014
    Posts:
    38
    The API page for NavMeshAgent.CalculatePath is not updated.