void TakeDamage(float damage) { damageText.CreateText(damage, transform); if (damage >= health) { mission.AddKill(); Destroy(Instantiate(explosion, transform.position, Quaternion.identity), 1f); Destroy(this.gameObject); } else { health -= damage; } healthSlider.UpdateSlider(); }