Search Unity

Navmeshes in AR Foundation

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

  1. JakHussain


    Oct 20, 2016
    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


    Unity Technologies

    Apr 21, 2017
    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


    Dec 14, 2016
    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:


    And my navmesh agent component looks like this


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