Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Nav mesh problem, character needs to start on terrain

Discussion in 'Editor & General Support' started by UniversalGesture, Nov 11, 2018.

  1. UniversalGesture

    UniversalGesture

    Joined:
    May 29, 2017
    Posts:
    116
    I noticed that in order for my character to be able to use nav mesh, it needs to start on a baked terrain at the beginning of the game. If it starts on an object or midair it won't work. How can I solve this?
     
  2. Sharlatan

    Sharlatan

    Joined:
    Jul 23, 2013
    Posts:
    111
    If that is a problem for you, you could activate the NavMeshAgent component only after it is near a baked mesh.
     
  3. UniversalGesture

    UniversalGesture

    Joined:
    May 29, 2017
    Posts:
    116
    Yeah but then the character can't use the pathfind script which works both on terrain and objects.
     
  4. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    5,457
    I don't think Unity supports pathfinding without NavMesh out of the box. AFAIK
     
  5. UniversalGesture

    UniversalGesture

    Joined:
    May 29, 2017
    Posts:
    116
    The pathfind script works fine on non terrain objects, but I'm not sure why my character has to start on a terrain
     
  6. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    5,457
    Okay, let's go in to the details, could you please describe what is the exact error or event you see and whether or not you have a baked navmesh on the very object you try to start on?
    You can't really use pathfinding midair, as I said, Unity does not support off-mesh pathfinding AFAIK except for the OffMesh Links.
    And even in the example you can see that they are baking on an object. https://docs.unity3d.com/Manual/nav-BuildingNavMesh.html
     
unityunity