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