Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Navmesh CalculatePath return path that passing through unwalkable area

Discussion in 'Navigation' started by cyyee, Mar 28, 2022.

  1. cyyee

    cyyee

    Joined:
    Jan 3, 2022
    Posts:
    1
    I'm creating an AI patrolling system and using Navmesh component to create the navmesh for the map like the following image.
    WhatsApp Image 2022-03-28 at 14.12.12.jpeg
    Grey colour area is unwalkable area.
    When I try to use CalculatePath to get the nearest path to destination, it return a path that will passing through unwalkable area for unknown reason.
    WhatsApp Image 2022-03-28 at 12.57.05.jpeg
    The yellow line is the path generated by using Navmesh path corners that returned by CalculatePath. Points generated are on the walkable area, but somehow it ignore some unwalkable area when calculating the path.

    Anyone know what is the problem and how to solve this kind of issue. Thanks a lot!