Search Unity

NavMesh doesn't seem to produce the shortest path

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

  1. dev_project

    dev_project

    Joined:
    Jan 31, 2020
    Posts:
    23
    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.