So, I am unsure if this is cause might be outdated tutorial I’m using the Survival Shooter making a enemy, It shows I should use NaveMeshAgent but when i input it for NavMeshAgent nav; It wont highlight like it would with the Transform player; So I’m unsure what I am doing wrong. It spits out: “The type or namespace name NavMeshAgent could not be found(are you missing a using directive or an assembly reference?)” When I go to quick fix guide it mentions using UnityEngine.AI but I am unfamiliar with that and unsure if that would be the solution to my problem.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DragonMove : MonoBehaviour {
Transform player;
NavMeshAgent nav;
void Awake()
{
// Set up the references.
player = GameObject.FindGameObjectWithTag("Player").transform;
nav = GetComponent<NavMeshAgent>();
}
void Update()
{
nav.SetDestination(player.position);
}
}