Search Unity

Bug SetDestination not working when direction intersects navmesh vertices

Discussion in 'Navigation' started by mirostraka, May 27, 2021.

  1. mirostraka

    mirostraka

    Joined:
    Feb 17, 2014
    Posts:
    41
    Sorry if this is not a bug, but I've been playing with all day today and see no other options.

    Just wanted to check here before possibly submitting a bug report - maybe someone encountered something similar or knows a workaround.

    Agent is able to calculate path, path is complete, but calling SetDestination() does nothing once direction of the path intersects vertex on navmesh (and either angle of direction and edge are similar or agent is close to the edge, I'm not quite sure) - check the image. Agent just gets stuck.
    upload_2021-5-27_16-4-50.png
    In Unity 2020.2.0f1.
    Is there anything I could do here - I think I'll have to just use agent for path calculation, and move it other way, or is there perhaps a setting I am missing that tells the path calculation not be this close to the edges?

    Are your agents not getting stuck in these situations?
    I saw other 'navmesh edge' bug threads but nothing was quite similar/helpful.