Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
There is an error.
I downloaded the package and I imported it into unity and it worked until the import finished then it said "Assets/Standard Assets/Characters/ThirdPersonCharacter/Scripts/AICharacterControl.cs(10,16): error CS0246: The type or namespace name
NavMeshAgent' could not be found. Are you missingUnityEngine.AI' using directive? " I don't know what to do.
Jennifer NordellTreehouse Teacher
Hi there! I did some research and found this thread talking about this specific eror in Unity. It seems the solution might be adding this to the top of your file:
Apparently some objects and methods have been moved around inside the namespace. Try this and see if it helps. Otherwise, you're likely going to have to wait for an answer from Nick.
Hope this helps!
K Cleveland21,839 Points
Going off of what Jennifer wrote: "Are you missing UnityEngine.AI' using directive?" is where you should focus your attention. It seems likely that in this case, because you didn't include "using UnityEngine.AI;" you are unable to refer to NavMeshAgent.
It's really helpful to be able to recognize this type of error, because it is incredibly common and you will see versions of this error across multiple languages, not just in the Unity Editor(and C#).