1. Help us improve the editor usability and artist workflows. Join our discussion to provide your feedback.
    Dismiss Notice
  2. We're looking for feedback on Unity Starter Kits! Let us know what you’d like.
    Dismiss Notice
  3. We’re giving 2017.1 beta testers a chance to win t-shirts and a Nintendo Switch. Read more on the blog.
    Dismiss Notice
  4. We want to know how you learned Unity! Help us by taking this quick survey and have a chance at a $25 gift card
    Dismiss Notice
  5. Are you an artist or level designer going to Unite Europe? Join our roundtables there to discuss artist features.
    Dismiss Notice
  6. Unity 5.6 is now released.
    Dismiss Notice
  7. Check out all the fixes for 5.6 on the patch releases page.
    Dismiss Notice

How does NavMesh system determine which horizontal surfaces to include?

Discussion in 'Navigation' started by trzy, Jun 19, 2017 at 5:05 AM.

  1. trzy

    trzy

    Joined:
    Jul 2, 2016
    Posts:
    43
    Hi,

    I'm building nav meshes using the scripting API (needs to be done this way on HoloLens because the spatial meshes are not available until the user scans his/her room). It's unclear to me which surfaces the NavMesh selects. The default rotation for NavMesh data is Quaternion.identity and I know it uses the up vector but given a mesh with lots of raised platforms, as in the image below, how does it determine what to include and exclude?

    For example, the picture here shows a captured scan of my room. You can see the NavMesh system has processed the floor. But why not instead the bed, for example?

    Also, is it possible to have completely discontinuous regions? I would be quite happy to have raised platforms (e.g., the bed or the couch in this image) constitute NavMesh surfaces of their own with no links to the floor. Agents placed on the bed would be confined to the bed, etc.

    The way I presently build my NavMesh is to include all meshes and a gigantic bounding box that is guaranteed to enclose them all (where the origin at Vector3.zero is chosen arbitrarily by the HoloLens).

    Thank you!

    Bart navmesh.jpg
     
  2. Jakob_Unity

    Jakob_Unity

    Unity Technologies

    Joined:
    Dec 25, 2011
    Posts:
    255
  3. trzy

    trzy

    Joined:
    Jul 2, 2016
    Posts:
    43
    Thank you for the reply! I thought I had followed up but I guess my post got swallowed. It turns out the problem was the height of my nav mesh agent! It was very large, and I guess the voxelization is proportional the agent dimensions.

    By the way, how can multiple nav mesh agent settings be defined in the scripting API? Given n input meshes and k agent types, is the idea to generate k NavMeshData objects by using UpdateNavMeshData() multiple times, once for each agent type?