Search Unity

NavMeshAgent acts as though the NavMesh is missing

Discussion in 'Navigation' started by SlyFox_Adam, Jul 6, 2019.

  1. SlyFox_Adam

    SlyFox_Adam

    Joined:
    Oct 4, 2018
    Posts:
    2
    At a loss with the NavMeshAgent, seems to disable itself when the game begins and starts throwing errors.

    "SetDestination" can only be called on an active agent that has been placed on a NavMesh.
    "Resume" can only be called on an active agent that has been placed on a NavMesh.
    "GetRemainingDistance" can only be called on an active agent that has been placed on a NavMesh.

    This is just whilst it's trying to navigate around in a wander state, I know these errors normally throw when the NavMesh itself is missing, but it isn't, it's baked. Secondly to this if I then manually enable the NavMeshAgent again it kicks in and starts it's AI cycle correctly.

    I've also checked and the height is correct, it's sat on the NavMesh correctly.
     
  2. mistergreen2016

    mistergreen2016

    Joined:
    Dec 4, 2016
    Posts:
    226
    Try disable the agent by default and turn them on right after Start. It seems like the navmesh isn't enabled at Start.