When Health Decreases
Fires whenever the health value of this object goes down, for example when it takes damage.
Introduction
When Health Decreases is an event in the Health Point group of World Events. It fires whenever the health value of this object goes down, for example when it takes damage. This event carries no parameters. Like every event, it does nothing by itself. It waits for the right moment, then runs all the actions connected to it. This event belongs to the Health component. Open the Health component guide to see everything the component itself can do. Health on objects follows the same three-beat family as characters: When Health Increases covers repairs, and When Health Reduces to Zero marks destruction - after which When Destroyed takes over. Damage sources arrive from When Bullet Hits and When Melee Hit , and health rules on the asset are configured with the Object Logic guide. When Health Decreases event in the World Editor Image The When Health Decreases event in the Script Editor. caption
Parameters
Value the amount of health lost Source character the character that caused it Source player the player behind that character Parameter Description
How to Access
How to Access - Event When Health Decreases
How to Use
Select the object, press Propertie (the blue equalizer icon) in the bottom action menu, and scroll to the bottom of the properties panel. Press Add Component and pick the Health Point component; its block stacks below the existing properties with the When Health Decreases event inside it. Press the + button below the event to add a script, then press Edit on that script to open the script editor and build the actions that should run when the event fires. Press Play and damage the object, then check that the actions run.
Example
When health decreases: raise the object by 2, wait 0.1 seconds, then reduce its height by 2. The object moves up by 2, pauses briefly, and returns by reducing its height by 2.
Common Uses
Shake an object or character when it takes a hit Show cracks or damage effects as health drops Play a hit sound when damaged
Tip
Use When Health Reduces to Zero instead if you only care about the moment health runs out.