When character is killed
Fires when the character dies.
Introduction
When Character Is Killed is an event in the Character group of World Events. It fires when the character dies. Like every event, it does nothing by itself. It waits for the right moment, then runs all the actions connected to it. Use it for death effects, from an explosion of particles to a game-over screen, at the exact moment the character goes down. This event belongs to the Character component. Open the Character component guide to see everything the component itself can do. Death is only one step in the loop: it is typically triggered by combat events like When Health Reduces to Zero on Character , and it is always followed by When Character Respawns . Other life-cycle beats - jumping, landing, walking - are covered by the rest of the Character family, and the Character guide shows how to configure killable characters and their defeat animations. When character is killed event in the Uni editor Image The When character is killed event in the Script Editor.
Parameters
Player the player whose character died Parameter Description
How to Access
How to Access - Event When character is killed
How to Use
Click the mannequin on the Spawn Point to select the Starter Player , scroll to the bottom of its properties panel, and press Character to expand the Character section. Press Character Events at the bottom to expand its event list; only three events (jump, killed, and respawn) show up at first. To reveal the others, press the ⋯ button at the right of the Character Events property, scroll down in the popup, and tick the checkbox of the event to show — When Killed . 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 defeat the character, then check that the actions run.
Example
When character is killed: Execute Self Character.Controlling Player.Inventory.Remove All Items when-character-is-killed-example.png Clears the controlling player's inventory when their character is killed. caption
Common Uses
Death effects and sounds Show a game-over or retry message Track deaths for a challenge counter
Tip
This fires on every death, including forced kills from the Kill command. Guard the actions if only some deaths should react.