// Apply a certain amount of damage public void ApplyDamage(float amount) { // Reduce or set to kill player if (health - amount > 0) { health -= amount * reduction; } else { Kill(); } // Set Health PlayerStatsUI.SetHealthRemaining(health); }