Description: At death the creature will die, fall to the ground and a grave will grow out of the land with a tombstone at the creatures head end. After 6 seconds the grave and tombstone will disappear. Add this brain kode to any character you want to have this death animation. (Note: This has been optimised for the goblin death sequence, for other creatures you may need to alter the timing or sizes)
- WHEN [once] DO [destroy after death][equals][false]
- WHEN [started to][is dead] DO [boolvar:dying][equals][true]
- WHEN [boolvar:dying]
- …WHEN [swimming] DO [destroy] // this prevents the grave being made in the water (which does not look good)
- …WHEN [countdown timer]
- …/…WHEN DO [add terrain][duration][box][size][0.9][material slot 8] // whatever material slot is appropriate for your grave; the duration is the length of time the grave is in your world before it disappears
- …/…./…WHEN [once] DO [objvar:tombstone][equals][create][Tombstone B][at position][head][position][toward][left foot position]
- …/…/…/….WHEN DO [objvar:tombstone][position][y][equals][position][y][plus][0.8]
- …/…/…/…WHEN DO [play creation effect][objvar:tombstone]
In your tombstone brain
- …WHEN [countdown timer] DO [destroy] // I couldnt put this in the goblin brain because it was already destroyed
Now in the world I created the water level was such that the goblin was pushed into the ground into the water when the grave is built and line 4 destroyed the goblin. If this is not the case in your world add [destroy] as a child line to line 5 or line 10.
In my level I had a variation on this with a bugler playing “The Last Post”. For this make a kinect emote of the bugler playing and a countdown timer in the bugler to destroy him when the emote is finished.
WHEN DO [emote][bugling]
WHEN [countdown timer] DO [destroy]
Attach your bugler to the side of the tombstone you create and it will be created with the tombstone. Remember to change the duration of the grave and the destruction of the tombstone to fit your bugling emote length.