UnityEngine.AI.NavMeshAgent nav; // Reference to the nav mesh agent. void Awake() { player = GameObject.FindGameObjectWithTag("Player").transform; playerHealth = player.GetComponent <PlayerHealthLF>(); enemyHealth = GetComponent <EnemyHealth>(); nav = GetComponent <UnityEngine.AI.NavMeshAgent>(); }
float timer; // Timer for counting up to the next attack. void Awake() { player = GameObject.FindGameObjectWithTag("Player"); playerHealth = player.GetComponent <PlayerHealthLF>(); enemyHealth = GetComponent <EnemyHealth>(); anim = GetComponent <Animator>(); }