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. Dismiss Notice

Question I can't use NavMesh Agent in Unity.

Discussion in 'Editor & General Support' started by alexjeminixz, Sep 1, 2023.

  1. alexjeminixz

    alexjeminixz

    Joined:
    Jul 30, 2023
    Posts:
    2
    I have Unity version 2022.3.8f1, and I'm trying to use NavMeshAgent in a project, but I can't find the option anywhere. It's not in the settings, not in the Window tab, not in components, nowhere. I'm new, and I saw in some videos that they go to Window-AI and use it there, but I don't have that option. 'AI' doesn't appear in my Window tab. Within the script, I'm using 'using UnityEngine.AI;' and there are no errors in the code. However, in the editor, I'm getting an error that says, 'There is no 'NavMeshAgent' attached to the 'Jugador' game object, but a script is trying to access it. You probably need to add a NavMeshAgent to the game object 'Jugador'. Or your script needs to check if the component is attached before using it.' But when I try to add the component to the object, it doesn't appear. If anyone can help me, I would appreciate it.

    1.png 2.png
    3.png
     
  2. BABIA_GameStudio

    BABIA_GameStudio

    Joined:
    Mar 31, 2020
    Posts:
    488
    Go into Window > Package Manager, and install the AI Navigation package. Then you should have access to all the Nav Mesh items.
     
    jacobrosspechal and alexjeminixz like this.
  3. alexjeminixz

    alexjeminixz

    Joined:
    Jul 30, 2023
    Posts:
    2
    The solution was really easy haha, thank you very much!!!
     
  4. jamilpoop2008

    jamilpoop2008

    Joined:
    Tuesday
    Posts:
    1
    I did install the Ai navigation package int he packet manager but I am still unable to use the navmesh agent component, can someone help me??