AC_HealthComp is an Actor Component designed to manage the health system of its owning Actor (typically a character or any damageable entity). It initializes the health value, listens for damage events applied to the owner, updates the current health accordingly, and handles death logic. This component centralizes health management and provides hooks for reacting to health changes and death events.
Variable Name | Type | Purpose |
---|---|---|
CurrentHealth | Float | Tracks the current health value of the owner. It is initialized to MaxHealth and updated when damage is applied. |
MaxHealth | Float | Defines the maximum health the owner can have. Used to initialize CurrentHealth and clamp its value. |
OnHealthChanged | Delegate (Event) | Intended to broadcast health changes to listeners. Not currently used in the Blueprint but designed for external binding to respond to health updates. |
CurrentHealth
to the value of MaxHealth
at the start of gameplay.OnTakeAnyDamage
event, binding it to the custom event OnOwnerTakeAnyDamage
. This ensures the component is notified whenever the owner takes damage.ApplyDamage
function, passing the damage amount received.Do Once
node to ensure death logic executes only once.Switch Has Authority
node (details truncated), likely to differentiate behavior between server and client or to trigger further death-related logic.CurrentHealth
.