public void StrikeTarget(float damage) { if (currentTarget) { Defender defender = currentTarget.GetComponent <Defender>(); HealthPoints hp = currentTarget.GetComponent <HealthPoints>(); if (hp) { hp.ReduceHP(damage); defender.Damaged(hp); if (hp.getCurrentHP() <= 0) { defender.Die(hp); } } } }