Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

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:
    19
    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.