float timer; // Timer for counting up to the next attack. void Awake () { // Setting up the references. player = GameObject.FindGameObjectWithTag ("Player"); playerHealth = player.GetComponent <PlayerHealth> (); enemyHealth = GetComponent<EnemyHealth>(); anim = GetComponent <Animator> (); }
void Awake () { // Set up the references. player = GameObject.FindGameObjectWithTag ("Player").transform; playerHealth = player.GetComponent <PlayerHealth> (); enemyHealth = GetComponent <EnemyHealth> (); navAgent = GetComponent<DungeonNavAgent>(); }