I, have a problem when i write a nav mesh agent variable, but it say: Type or namespace name 'NavMeshAgent' not found (are you missing a using directive or an assembly reference?) [Assembly-CSharp] using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEditor.AI; public class AnimAIPlayer : MonoBehaviour { public NavMeshAgent navMeshAgent; // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { } }
You need to add a using statement for the namespace it's in, which is probably UnityEngine.AI. But any modern IDE would tell you that automatically without a trip to the forums. The documentation tells you, too (https://docs.unity3d.com/ScriptReference/AI.NavMeshAgent.html). I strongly suggest that you learn C# before delving into pathfinding or any kind of AI or other unity development.