Can't find NavMeshAgent data type

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

1 Like

I have the same problem and I’m using 5.5 as well.

Just figured it out lol. import UnityEngine.AI.
so type:
using UnityEngine.AI;

15 Likes

thanks for help maan. you saved my life :slight_smile:

1 Like

no problem, good luck with your Unity adventures!

thanks

thank you very much!

Thanks Man! I’m a newbie and was stuck in a tutorial because of this.

where do i put this in the code???

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
}

Thanks so much!

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?

Bruh! may the god behold his blessing of wisdom on you

i did what you said to do @Darkmatter520 and it still dosent work

Hmmm, can you tell me what it is saying is wrong? Is the import not working or something else?

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.

You have to enable the built in package ‘AI’ in the Package Manager window to fix this error.

2 Likes

Thank you for helping me a lot!

Thanks,
Zhang

bro you’re a legend thank you