Search Unity

Failed to create agent because there is no valid NavMesh ONLY on mobile device

Discussion in 'Navigation' started by mistergreen2016, Jun 19, 2019.

  1. mistergreen2016

    mistergreen2016

    Joined:
    Dec 4, 2016
    Posts:
    87
    Hey I'm having a weird issue I can't figure out. Things work fine from the Unity IDE but when I run the game from a device like an iPad, I get this error.

    Code (CSharp):
    1. Failed to create agent because there is no valid NavMesh
    And the agent are placed off the required Navmesh. It does get placed on a near by navmesh which I don't want.

    I'm using the Navmesh surface script to bake the terrain. I wonder if there's a timing issue where the navmesh haven't finished loading or something. I tried using LoadSceneAsync instead but got the same error.

    Any ideas?
     
  2. mistergreen2016

    mistergreen2016

    Joined:
    Dec 4, 2016
    Posts:
    87
    I found a hack where I agent.enabled = false on Start() or Awake(). Then turn it back on right after Start().