Code FIRSTPACK: 100 credits for $5 or 200 for $10, for the first 1000 orders. Credits never expire. See packs

How to Make a Health System in UE5 Blueprints

A health system in Unreal Engine 5 is two float variables on the character, Health and MaxHealth, plus Event AnyDamage: subtract the damage, Clamp between 0 and MaxHealth, and call an OnDeath Event Dispatcher once Health reaches 0. Every action game needs one, and it’s the classic first Blueprint: a float that goes down when things hurt you, clamps at zero, and tells the rest of the game when you die. The design decisions are where damage comes in and who gets told about death.

What it’s made of

Variables

Health and MaxHealth as floats (100/100 is the convention), optionally a RegenRate float and a bIsDead bool so death logic can’t fire twice.

Events

Event AnyDamage is the engine’s built-in entry point: anything calling Apply Damage on the actor lands here with the amount. Add a custom Heal event and an OnDeath Event Dispatcher so UI, game mode and enemies can all react without hard references.

The logic

On AnyDamage: subtract the amount, Clamp between 0 and MaxHealth, update the health bar, then Branch on Health <= 0, if true and not already dead, set bIsDead and call the OnDeath dispatcher. Regeneration is a looping Timer that adds RegenRate × interval while below max (and stops while dead).

Key nodes you’ll wire

Event AnyDamageApply DamageClamp (Float)BranchSet Timer by EventEvent Dispatcher (OnDeath)Set Percent (Progress Bar)

The mistake that breaks it

Skipping the Clamp and the bIsDead guard: health drifts negative, and OnDeath fires once per hit on a corpse, every downstream system runs its death logic repeatedly.

New to how Blueprint systems fit together? Read the anatomy of a Blueprint system first.

Or skip the wiring: generate it

Blueprint Studio builds this system from a plain-language prompt: the right nodes, exec and data pins wired, defaults set, and tells you whether it is ready to paste or what to set up first. The prompt is prefilled:

Build “Health System” in Blueprint Studio

Prompt variations to try

Paste it into your Blueprint, or apply it with the free Cosindra desktop app (Windows & macOS).

Common questions

Should health be a float or an integer in UE5?

Float. The engine’s damage pipeline is float end to end (Apply Damage sends a float and Event AnyDamage receives one) and regen ticks and percentage-based armor produce fractional values anyway. A progress bar’s Set Percent wants Health / MaxHealth as a float too. If the HUD should show whole numbers, round at display time with Floor or Format Text, never in the stored value.

How do I stop Event AnyDamage from firing after the character is dead?

The cheap guard is a Branch on bIsDead as the very first node after Event AnyDamage, so a corpse ignores incoming hits. To cut damage off at the engine level instead, call Set Can Be Damaged (false) in your death path: Apply Damage then never reaches the event at all. Re-enable it and clear bIsDead when the player respawns.

Does health replicate automatically in multiplayer?

No: Blueprint variables stay local unless marked replicated. Let the server own the number: apply damage only on the authority (guard the path with Switch Has Authority), set Health to RepNotify, and move the health-bar update into the generated OnRep_Health function so each client redraws when the value arrives. Clients never subtract health locally: they render what the server replicated.

How do I damage the player from an enemy or a hazard in UE5?

Call Apply Damage on the actor that was hit, with the amount, and the engine routes it to that actor’s Event AnyDamage. A spike trap does it from On Component Begin Overlap, a projectile from Event Hit, a melee swing from a trace. Because every source goes through Apply Damage, the health logic stays in one place and the hazard never needs to know how health works.

How do I show health on the HUD in UE5?

Make a Widget Blueprint with a Progress Bar, add it to the viewport on BeginPlay, and call Set Percent with Health divided by MaxHealth. Update it when health changes, from the damage and heal events or a HealthChanged dispatcher, rather than with a property binding that runs every frame.

More systems