Unable to initialize NavMesgAgent in script even though I have baked NavMesh

I’m still very new to Unity and I have just baked a NavMesh for my terrain yet when I try to create movement script for a generic enemy type, it does not give me the option to create a NavMeshAgent variable. I have attached two pics that show the problem. Am i not declaring it correctly or could there be another issue?


A few things.

  1. It is Capital “N” Public NavMeshAgent variableNavMeshAgent;
  2. Have you added a NavMeshAgent component to your character GameObject?
  3. You likely want to define it outside of the Start routine so all routines can access it. (i.e. between the Class and the Void Start() lines
  4. Initialize it in the Start routine with variableNavMeshAgent = GetComponent ();
  5. then in update perform the actions you want on the variableNavMeshAgent