Search Unity

NavMesh.FindClosestEdge issue

Discussion in 'Scripting' started by Terminus001, Apr 22, 2019.

  1. Terminus001

    Terminus001

    Joined:
    Nov 1, 2015
    Posts:
    121
    Hi everyone,

    The method NavMesh.FindClosestEdge seems to be highly unreliable. When used, most times it returns the correct closest Navmesh edge relative to the game object of interest. However, sometimes it does not work. If you see the picture below, the red arrow represents the game object relative to which the closest Navmesh edge should be found, while the blue arrow shows the position returned by NavMesh.FindClosestEdge(): this is definitely not the closest Navmesh edge.
    findclosestedge_notworking.JPG