private void OnTriggerEnter2D(Collider2D collision) { GuardMovement chasing = gameObject.GetComponentInParent <GuardMovement>(); if (collision.gameObject.tag == ("Player")) { chasing.GuardChasing(); } }
private void OnTriggerEnter2D(Collider2D collision) { GuardMovement chasing = gameObject.GetComponentInParent <GuardMovement>(); if (collision.gameObject.tag == ("Player")) { chasing.GuardChasing(); Animator anim = gameObject.GetComponentInParent <Animator>(); anim.SetBool("Alert", false); } }