Search Unity

Navmeshes in AR Foundation

Discussion in 'Handheld AR' started by JakHussain, Nov 5, 2018.

  1. JakHussain

    JakHussain

    Joined:
    Oct 20, 2016
    Posts:
    105
    I'm at a bit of a loss on how to get navmeshing working on the Planes detected by AR Foundation. I'm looking to set up an environment where I can detect my table and floor in AR, spawn a character on the table and use navmeshes to get the character to pathfind to the floor where they can jump down.

    This is super easy in a regular 3D scene but I don't even know where to begin with using AR Foundation. Any pointers?
     
  2. tdmowrer

    tdmowrer

    Unity Technologies

    Joined:
    Apr 21, 2017
    Posts:
    547
    One difference between AR and a "regular scene" is that you don't have the input geometry (i.e., the planes) during edit time, so you cannot create the nav meshes beforehand. You might want to check out this tutorial which shows you how to create nav meshes at runtime.
     
  3. thesanketkale

    thesanketkale

    Joined:
    Dec 14, 2016
    Posts:
    22
    Hi @tdmowrer
    I have followed the tutorial you mentioned here and built navmesh runtime, but it does not seem to generate navmesh surface on the detected planes. The same code generates navmesh on a separate plane gameobject at runtime and my agent moves from its current position to the desired position covering the shortest distance.
    But when it comes to creating navmesh on the detected planes, it does not seem to do it as when I remove the dummy plane, my agent does not move an inch.

    My navmesh surface component looks like this:

    upload_2019-9-24_21-2-38.png

    And my navmesh agent component looks like this

    upload_2019-9-24_21-5-37.png

    I am using the AR default plane generated by unity without any change. Am I missing anything here? Look forward to your response.

    Regards.