Search Unity

Can't find NavMeshAgent data type

Discussion in 'Navigation' started by freedom667, Jan 7, 2017.

  1. freedom667

    freedom667

    Joined:
    Sep 6, 2015
    Posts:
    425
    I will make an AI but I can't find the data type. I don't understand what's going on. if you know, how can i fix this?



    As you see, the data type is red. I using Unity 5.5
     
    hopetolive likes this.
  2. Darkmatter520

    Darkmatter520

    Joined:
    May 12, 2014
    Posts:
    12
    I have the same problem and I'm using 5.5 as well.
     
  3. Darkmatter520

    Darkmatter520

    Joined:
    May 12, 2014
    Posts:
    12
    Just figured it out lol. import UnityEngine.AI.
    so type:
    using UnityEngine.AI;
     
  4. freedom667

    freedom667

    Joined:
    Sep 6, 2015
    Posts:
    425
    thanks for help maan. you saved my life :)
     
    hopetolive likes this.
  5. Darkmatter520

    Darkmatter520

    Joined:
    May 12, 2014
    Posts:
    12
    no problem, good luck with your Unity adventures!
     
  6. freedom667

    freedom667

    Joined:
    Sep 6, 2015
    Posts:
    425
    thanks
     
  7. xYz23

    xYz23

    Joined:
    May 15, 2017
    Posts:
    2
    thank you very much!
     
  8. sarfarazh

    sarfarazh

    Joined:
    Jul 17, 2017
    Posts:
    1
    Thanks Man! I'm a newbie and was stuck in a tutorial because of this.
     
  9. HostileSpider

    HostileSpider

    Joined:
    Nov 16, 2017
    Posts:
    1
    where do i put this in the code???
     
  10. Darkmatter520

    Darkmatter520

    Joined:
    May 12, 2014
    Posts:
    12
    Put that line on the very top of the script underneath the other imports but before the object class.
    Example:
    using UnityEngine;
    using UnityEngine.AI;

    public class Something(){
    the rest of the script is here
    }
     
  11. dacs2010

    dacs2010

    Joined:
    Jan 19, 2018
    Posts:
    2
    Thanks so much!
     
  12. MarioLTU

    MarioLTU

    Joined:
    Apr 17, 2016
    Posts:
    1
    Assets/NavMeshComponents/Scripts/NavMeshSurface.cs(79,9): error CS0246: The type or namespace name `NavMeshDataInstance' could not be found. Are you missing an assembly reference?

    how to fix this?
     
  13. dh323

    dh323

    Joined:
    Dec 10, 2018
    Posts:
    1
    Bruh! may the god behold his blessing of wisdom on you
     
  14. clickinggames

    clickinggames

    Joined:
    Jun 6, 2020
    Posts:
    2
    i did what you said to do @Darkmatter520 and it still dosent work
     
  15. Darkmatter520

    Darkmatter520

    Joined:
    May 12, 2014
    Posts:
    12
    Hmmm, can you tell me what it is saying is wrong? Is the import not working or something else?
     
  16. Tressor_Studio

    Tressor_Studio

    Joined:
    May 28, 2013
    Posts:
    45
    I have the same problen after upgrade Unity 2020 version , I try to add "using UnityEngine.AI;" But dont work ..

    Assets\Standard Assets\Characters\ThirdPersonCharacter\Scripts\AICharacterControl.cs(7,46): error CS1069: The type name 'NavMeshAgent' could not be found in the namespace 'UnityEngine.AI'. This type has been forwarded to assembly 'UnityEngine.AIModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' Enable the built in package 'AI' in the Package Manager window to fix this error.
     
  17. Tressor_Studio

    Tressor_Studio

    Joined:
    May 28, 2013
    Posts:
    45
    You have to enable the built in package 'AI' in the Package Manager window to fix this error.
     
    havargas012 and qpuilie like this.
  18. qpuilie

    qpuilie

    Joined:
    Jan 14, 2020
    Posts:
    69
    Thank you for helping me a lot!

    Thanks,
    Zhang
     
  19. kobyonekenobi

    kobyonekenobi

    Joined:
    Nov 1, 2022
    Posts:
    1
    bro you're a legend thank you