When Destroyed
Fires when an object is destroyed, either by the Destroy command or by taking fatal damage.
Introduction
When Destroyed event in the World Editor screenshot-2026-10-11-052946.webp The When Destroyed event in the Script Editor. caption When Destroyed is an event in the DIY group of World Events. It fires when an object is destroyed, either by the Destroy command or by taking fatal damage. Like every event, it does nothing by itself. It waits for the right moment, then runs all the actions connected to it. Use it when you want something to happen automatically as soon as the object is destroyed. Destruction and creation are two sides of one life cycle: this event marks the end of an object, while When Object is Created marks its birth - use the pair for respawning crates, resetting puzzles, and counting destruction scores. Debris and effects tie into When Object Restores , and the logic that holds it together is described in the Object Logic guide.
Parameters
None This event has no parameters. The event fires on its own and everything you need is the object running this script. Parameter Description
How to Destroy an Object
overview 988482dd-adc4-4151-b084-da5976a24fe2.webp This setup shows the process of destroying an object using a script command. First, select the object you want to destroy in the Execute block. Then choose the Group command and select Destroy Self . This will remove the selected object instantly from the world when the event is triggered. Make sure the object has a script with the When Destroyed event. This is important so that any logic connected to that event will run after the object is destroyed. body caption
How to Access
How to Access - Event When Destroyed
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 Group component; its block stacks below the existing properties with the When Destroyed 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 destroy the object with the Destroy command, then check that the actions run.
Example
Spawn a model at Self position after When Destroyed fires when-destroyed-example.png Example: spawn a model at this object position when it is destroyed. caption
Common Uses
Drop loot or spawn a replacement object Play an explosion or break-apart effect Respawn the object automatically after a delay
Tip
Connect cleanup actions here so destroyed objects do not leave dangling state behind.