Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

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 Moderator

    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