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

N.M.A. remainingDistance is 0 if target is on walkable

Discussion in 'Navigation' started by elettrozero, Jul 11, 2017.

  1. elettrozero

    elettrozero

    Joined:
    Jun 19, 2016
    Posts:
    216
    I've two NVA and one is working just fine, so, it's for sure a missconfiguration.
    When the target is on a walkable surface remainingDistance is 0, otherwise is Infinity and only in that case the Agent moves....
     
  2. Jakob_Unity

    Jakob_Unity

    Joined:
    Dec 25, 2011
    Posts:
    269
    remainingDistance returns the remaining distance of its current path - meaning while a path is being calculated (pathPending is true) the remainingDistance does not reflect that (yet).

    This also means that if a path is calculated for a newly initialized agent and that takes - say 10 frames - the remainingDistance at those first 10 frames will be zero (but pathPending will be true).

    Maybe this is the what you're seeing ?
     
  3. elettrozero

    elettrozero

    Joined:
    Jun 19, 2016
    Posts:
    216
    I'm not sure but I'm adding the pathPending control to make things better. Thank you