void OnCollisionEnter2D(Collision2D collision) { if (collision.gameObject.tag == "Player") { if (player.RotationMode == true && mole.invincible == false) { mole.hp -= 1; mole.GetComponent <AudioSource>().clip = mole.SE_damage; mole.GetComponent <AudioSource>().Play(); mole.GetComponent <Animator>().SetBool("takeDamage", true); mole.StartCoroutine("InvincibleTime"); if (mole.hp <= 1) { mole.throwingWait = 0.5f; mole.speed_x *= 1.5f; mole.burrowsWait = 1.0f; } if (mole.hp <= 0) { mole.Action = Mole.ActionPart.Death; } } } }