Search Unity

Error with NavMeshAgent

Discussion in 'Navigation' started by GemstoneMiner, Feb 6, 2022.

  1. GemstoneMiner

    GemstoneMiner

    Joined:
    Jan 1, 2022
    Posts:
    3
    Ive been trying to make some enemies for my 3d game recently so I followed tons of tutorials but whenever I put agent.setdestination into my script an error message comes up saying
    "SetDestination" can only be called on an active agent that has been placed on a NavMesh.
    UnityEngine.AI.NavMeshAgent:set_destination (UnityEngine.Vector3)
    The game also pauses and i cant unpause it.
     
  2. JavaBob

    JavaBob

    Joined:
    Apr 24, 2018
    Posts:
    20
    As it said, "SetDestination" can only be called on an active agent that has been placed on a NavMesh. You either have not baked the navmesh or the agent is too far away/above the navmesh.