Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Navmesh behaves differently at runtime?

Discussion in 'Navigation' started by yuriythebest, Jun 19, 2023.

  1. yuriythebest

    yuriythebest

    Joined:
    Nov 21, 2009
    Posts:
    1,121
    Hi all! I have a weird issue: everything works fine in the editor, however at runtime the navmeshAgents run straight through doors (which have navMeshObstacles attached with "carve" turned on). I even tried increasing the size of the navMeshObstacle on the door but same thing. any ideas?
     
  2. yuriythebest

    yuriythebest

    Joined:
    Nov 21, 2009
    Posts:
    1,121
    Okay, to anyone else having the issue of NavMeshAgents ignoring NavmeshObstacles at runtime, after trying much everything (increasing navMeshAgent priority/quality, increasing the size of the navMeshObstacles-etc - none of that worked). What does work and what seems to be at the core of the issue is simplifying the object hirearchy - at runtime it seems to work when the obstacle is in the root of the scene and not part of a complex hirearchy, and even then, "sometimes". so yeah, experiment and tinker and hopefully something will work for you...