Health
Gives the object hit points, so weapons can hurt it, damage zones can heal or wound it, and breaking apart becomes possible.
Introduction
Health gives the object hit points, so weapons can hurt it, damage zones can heal or wound it, and breaking apart becomes a real possibility. For characters, use Character Health instead, which shares the same health logic and events. The Health component panel in the Uni editor Image The Health component panel in the Object editor. caption
How to Access
Select an object, open the Properties Panel, then press the Add Component button at the bottom and pick Health. The component stacks onto the object as a new accordion of properties. How to Access - Add Component in the Properties Panel
Another Way to Access
Shortcut: open the Asset Panel, go to the Device tab, Others category, and click the Health point block. It spawns an object with the Health component already attached, ready to adjust its hit points and health bar. How to Access - the Health point block in Asset Panel > Device > Others
Properties
Max Health Int The most hit points the object can hold. Current Health The hit points it has right now. Respawn Float How long until the object comes back after breaking. Displayed Enum When the health bar shows: only after taking a hit, never, or always. Cooldown A brief invincibility window after each hit, before the next one can land. Multiplier Scales incoming damage up or down by this factor. Show Damage Bool Displays floating damage numbers when hit. Destroy Effect Effect The visual effect that plays when the object breaks. Property Type Description Every property on the Health component.
Events
When Health Decreases Fires whenever the object loses health. None When Health Increases Fires whenever the object gains health. When Health Reduces to Zero Fires when the hit points run dry and the object breaks. Event Description Parameter Every event on the Health component. Each event links to its full guide, where its parameters and example live.
Commands
Reset Health Refills the health back to maximum. None Command Description Parameter Commands that drive the component from a script.
Example
Add health to an object and destroy it with a weapon Health - Simple Example