Search Unity

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

Question Navmeshpath is not going around obstacles

Discussion in 'Navigation' started by GamingPugsStudios, Jun 25, 2023.

  1. GamingPugsStudios

    GamingPugsStudios

    Joined:
    Sep 26, 2019
    Posts:
    7
    Hi,

    I use a navmeshagent that doesn't move to check if the player enclosed his castle after spawning walls.

    Sometimes the agent does not calculate the path correctly, instead of calculating a path around the objects it just stops infront of them and I can't figure out why. (See image)

    Is there any way to change this behaviour?

    Greetings Maikel
     

    Attached Files:

  2. androvisuals_unity

    androvisuals_unity

    Joined:
    Mar 23, 2020
    Posts:
    47
    Use the navMeshPath status to check if a path is partial or invalid, if it is invalid wait something like 0.5 seconds and try to calculate the path again.