void OnTriggerEnter(Collider other) { HUD_Manager hudmanager = other.gameObject.GetComponent <HUD_Manager>(); if (hudmanager != null) { hudmanager.UpdateHealth(AttackDamage); } }