Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

NavMesh doesn't seem to produce the shortest path

Discussion in 'Navigation' started by devprojectonline, Jul 19, 2020.

  1. devprojectonline

    devprojectonline

    Joined:
    Jan 31, 2020
    Posts:
    1
    Hello,

    I've been trying some simple tests with NavMesh and I am seeing some strange artefacts:
    upload_2020-7-19_18-21-52.png

    Grey objects are obstacles and red lines is the path produced via NavMesh.CalculatePath. As you can see the red path is not the shortest path from srs to dust. Interestingly sometimes if I try a path from dst to src (i.e. swapping dst and src) it may produce the shortest one. Is this the expected behaviour or am I missing something? Thanks.
     
unityunity