Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. The 2022.2 beta is now available for testing. To find out what's new, have a look at our 2022.2 feature highlights.
    Dismiss Notice
  3. We are updating our Terms of Service for all Unity subscription plans, effective October 13, 2022, to create a more streamlined, user-friendly set of terms. Please review them here: unity.com/legal/terms-of-service.
    Dismiss Notice
  4. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice
Dismiss Notice
Submit bug reports tagged with #Beta2022Win_Unity when you encounter unknown issues while testing the 2022.2 betas for a chance to win a year of Unity Pro. For more information, have a look at our Beta Sweepstakes Announcement.

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
     
unityunity