/// <summary> /// /// if the player enters the enemies attack range we then attack them /// the attack range for melee attacks is dictated through using collider triggers /// /// <para> Author: Callum Dunstone </para> /// /// </summary> private void OnTriggerEnter(Collider other) { if (other.tag == "Player") { meleeAttack.AttackPlayer(); } }
/// <summary> /// /// this is used to check if the player has moved into attack range of the ghost /// /// <para>Author: Callum Dunstone</para> /// /// </summary> private void OnTriggerEnter(Collider other) { if (other.tag == "Player") { animat.SetBool("Attack", true); meleeAttack.AttackPlayer(); } }