public void TakeDamage(float amount) { currentHealth -= amount; FloatingText.DamagePopup(transform.position, (int)amount, 0, false); healthBar.fillAmount = currentHealth / maxHealth; if (currentHealth <= 0) { Die(); } }