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

How to use NavMeshQuery on several surfaces connected with NavMeshLinks?

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

  1. snorkysnark

    snorkysnark

    Joined:
    Oct 31, 2016
    Posts:
    4
    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?
    Thanks