Search Unity

Is point on navmesh or not?

Discussion in 'Navigation' started by neno1204, Sep 17, 2015.

  1. neno1204

    neno1204

    Joined:
    Jun 23, 2015
    Posts:
    14
    Is there way to check if point is on the navmesh or not?
     
  2. Mycroft

    Mycroft

    Joined:
    Aug 29, 2012
    Posts:
    160
  3. AngryAnt

    AngryAnt

    Keyboard Operator

    Joined:
    Oct 25, 2005
    Posts:
    3,045
    Use NavMesh.SamplePosition. This allows you to specify a maximum difference between the given point and the nearest point on the navmesh. If the nearest point is further away, the call returns false.
     
  4. azinsf7

    azinsf7

    Joined:
    Nov 14, 2020
    Posts:
    3
    Thank you sir that really helped me