Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  3. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

How to use NavMeshQuery on several surfaces connected with NavMeshLinks?

Discussion in 'AI & Navigation Previews' started by snorkysnark, Apr 29, 2020.

  1. snorkysnark


    Oct 31, 2016
    I'm trying to make a game that needs lots of entities to navigate on the walls of a room, so I wanted to try DOTS for that.
    As far as I can see, all the existing DOTS navigation solutions use NavMeshQuery in tandem with PathUtils.FindStraightPath from the Unity Austin Demo.

    Using NavMeshComponents, I set up a scene with a floor and a wall connected via a NavMeshLink.

    As seen on the screenshot, a normal NavMeshAgent goes through the link correctly, while the PathUtils path always goes through one of the link's corners, resulting in a janky path. The PathUtils algorithm was probably intended for flat surfaces only, but I don't understand is well enough to fix it.

    So, how do I calculate a correct path from the list of PolygonIDs returned by the query?