Stat Decrease
Decrease a stat (float), clamp it to zero, and optionally send an event when it reaches zero.
This is ideal for:
- Health / shields / armor
- Stamina / energy
- Fuel / ammo / heat
- Cooldowns or timers counting down
Parameters
| Parameter | Description |
|---|---|
| Stat | The stat value to decrease (e.g., Health, Stamina, Fuel). |
| Amount | How much to subtract from the stat. Can be used per second, for smooth drain over time. |
| Event On Zero | Event sent the frame the stat reaches zero. Not sent again while it stays at zero. |
| Store Is Zero | (Optional) Stores true if the stat is zero after the decrease. |
⚙️ Details
- The action subtracts Amount from Stat.
- The result is clamped to zero – it will never go negative.
- If the stat was above zero before, and becomes exactly zero after the decrease, the action sends Event On Zero once.
- If you use Store Is Zero, it will be:
trueif the stat ended at zerofalseif the stat is still above zero
You can also use the Per Second option (in the action settings) so that Amount is applied per second, which is useful for things like:
- Damage over time
- Stamina drain while sprinting
- Fuel consumption over time
Example Uses
-
Enemy Health
- Action: Stat Decrease (Health, DamageAmount, Event On Zero: Dead)
- When health reaches zero, send a Dead event and transition to a death state.
-
Fuel System
- Action: Stat Decrease (Fuel, FuelBurnRate, Event On Zero: OutOfFuel)
- When fuel runs out, send OutOfFuel and switch to a drift / powerless state.
-
Stamina Drain
- Action: Stat Decrease (Stamina, DrainRate per second)
- No event needed; just use Store Is Zero to check if stamina is empty.