Changing death animations

How to create different death animations 


When the health of a character reaches 0 the death animation of that character is activated. Generally the character/animal makes a death cry and falls to the ground. With goblins, there is also a death impact effect.

When destroy after death is turned on, the character will fall to the ground then explode in a green mist and are removed from the game.

With destroy after death turned off a body will remain. You also need to be aware that the brain Kode still functions in the body.
So, for example, if you had Kode that says when detect player say “Hello” the body would still do this – despite being dead. However, this ability can mean you can create your own death animations.


You can apply effects that happen as the character goes into it’s death animation, or just after.Experiment with this and I am sure you can come up with lots of interesting ways for your characters to appear when dying.

All the examples below were placed on character with their destroy after death turned off. Each brain contained this Kode;

 WHEN [started to][is dead] DO [boolvar:dying][=][true]
 WHEN [dying] DO

All additional code is added as a child line to line 2. Such as:


WHEN [started to][is dead] DO [boolvar:dying][=][true]
 WHEN [dying] DO
 ...WHEN [hologram]
 ...WHEN [countdown timer][3] DO [destroy]

Changing the speed of the death animation
By using pace you can speed up or slow down the fall to the ground. Slow motion gives a nice cinematic effect. It only applies to the character involved.

…WHEN DO [pace][=][0.15] //the number controls the speed, 0.15 gives a slow motion effect
…WHEN [countdown timer][4] DO [destroy] // this will remove the body from the world. It is optional. The length of the timer is determined by the speed of the line above, and may need to be shorter or longer

Replacing the dead character with an object
Instead of leaving a dead body you could leave loot for the player to pick up, or a brief marker in the air

…WHEN DO [visible][=][false]
…WHEN DO [collidable][=][false] // because we want to run an effect after the character appears to have been destroyed we need to make them invisible and non collidable

…WHEN [for each of][attachments] DO [destroy] [it] // Attached items do not become invisible with the character, so we need to destroy them

…WHEN [once] DO [objvar:deposit] [=][create][IWP: your object][at position][head][position] // this is a good position for a standard goblin. For another character you might try root, position, or other socket

…WHEN [countdown timer][3] DO [destroy][objvar:deposit] //this is if the object is a marker. Leave this out if it is a loot drop, or you want the object to stay in the world. Be aware that this will increase your prop count in the world, and with a lot of these scattered about it may effect your game’s performance.

…WHEN [countdown timer][3.5] DO [destroy] // this removes the character from the world

Options for this:

A coin
A bag (of coins)
A weapon
An xp token
A key


A skull
A pile of bones
A cross
A gravestone

Create a small grave
A variation on the marker is to build a small grave where the goblin falls, with a mound of earth and a gravestone.You could even put flowers or a wreath on it if you like – use IWP instead of straight from the gallery.


…WHEN[countdown timer][2] DO
…/…WHEN DO [add terrain][box][size][0.9][material slot 8] // place a suitable soil material at slot 8
…/…/…WHEN [once] DO [objvar:tombstone][=][create][Tombstone B][at position][head][position]
…/…/…/…WHEN DO [objvar:tombstone][position][y][=][position][y][+][.0.8]
…/…/…/…WHEN DO [play creation effect][objvar:tombstone] // this makes it grow out of the mound
…WHEN [countdown timer][5] DO [destroy] // give plenty of time for the grave to be built before destroying the character

Change the dead body to another
Maybe you kill a wolf and it turns into a human at death (a werewolf!). Or maybe you kill a goblin and it turns into a tree. Lots of options. The code below is for goblin to man.
Create a dead peasant by turning destroy after death off and starting health at 0. Also make him a template and visible off.

…WHEN [started to] DO [objvar:man][=][create][IWP:dead Woodland peasant][at position][position]
…WHEN [countdown timer][4] DO [visible][=][false]
…/…WHEN DO [objvar:man][visible][=]true]
…WHEN [countdown timer][6] DO [destroy] // this destroys the goblin, leaving the man.

Change the death special effect


…WHEN [countdown timer][2] DO [shrink]
…WHEN [countdown timer][3] DO [destroy]

Change to a hologram

…WHEN DO [hologram]
…WHEN [countdown timer][3] DO [destroy]

Create smoke or dust or any other visual effect

…WHEN DO [play fx][put your effect here]
…WHEN [countdown timer][1] DO [destroy]

Create an apparition

To get a rising ghost or angel come out of the body. Create an angel and make it a hologram in its brain.

…WHEN [once][countdown timer][2] DO [objvar:angel][=][create][IWP: your angel][at position][root][position]
…WHEN DO [objvar:angel][gravity factor][=][-0.1] // this will make it rise
…WHEN [countdown timer][6] DO [destroy angel]
…WHEN [countdown timer][7] DO [destroy]

For a flock of birds (a bit like La Lande by Zgloug)
Place a crow or other bird and make it a hologram. There is Kode in its brain that says when the player gets close to fly away. Remove the effect that gives a cloud of feathers (as they wont be the right colour) unless you want to go to the effort of colouring the effect as a template and using IWP.
Put a few facing out from the centre in a circle and glue them.
Put this in the glued object brain

WHEN [countdown timer][6] DO [destroy]

in the character brain

…WHEN [once][countdown timer][2] DO [create][Glued object]
…WHEN [count down timer][61][in frames] DO [destroy] // this will appear to remove the character and replace with the birds

Blood effects
Be aware that blood effects may mean you wont be on the curated feed (so if parental controls are on, your game will not appear on the feeds). For this you will need Epic Artist.

…WHEN [started to] DO [play fx][IWP:FX Gizmo][volume][0] // I used a rock explosion coloured red. Best to take out any noises that are inappropriate
…WHEN [once][countdown timer][1] DO [paint terrain][radius][1][material slot 10][amount][100] // the material slot was snow coloured red
…/…WHEN DO [secondary color][=][red] // this turned my goblins shorts red when he died. You can play about with this and primary, tertiary, solid colors. Optional.

Comments are closed.

Website Powered by

Up ↑

%d bloggers like this: