Health Modifiers
Health modifiers are components you add next to Health on the same GameObject. While a modifier is enabled, it sees every hit before Health applies it and can change or block the damage. Disable it and it stops affecting damage.
⚙️ How It Works
flowchart LR
A["Damage"] --> B["Modifier"] --> C["Health"]
- A modifier hooks itself into the
Healthwhen it’s enabled, and unhooks when it’s disabled. - Modifiers run in the order they were enabled.
- Each one receives the damage left by the previous one.
- If the damage reaches zero or less, the hit is blocked and health doesn’t change.
- Only damage goes through modifiers. Healing skips them.
🛡️ Built-in Modifiers
| Modifier | What it does |
|---|---|
| Invincibility | Blocks all damage while enabled |
🧑💻 Writing Your Own
Derive from HealthModifier to make armor, damage resistance or a shield. See Modifiers in the scripting reference.