void OnCollisionEnter2D(Collision2D other) { if (other.gameObject.tag == "Bullet") { bullet = other.gameObject.GetComponent <BulletMoveFoward>(); TakeDamage(bullet.damage); } }
void OnCollisionEnter2D(Collision2D other) { if (other.gameObject.tag == "Bullet") { enemyAudio.Play(); bullet = other.gameObject.GetComponent <BulletMoveFoward>(); TakeDamage(bullet.damage); //anim.SetTrigger("Hit"); } }