Some of my monsters explode in colourful effects when they die. I usually do this when the monster has no death animation. If your monster has this problem or you just think it would look cooler than them falling over then keep reading. This tutorial will show you how.
To do this all we have to do is alter one function and include our spawning code. The PlayDying function is a good place to do the spawning because it is called when the monster dies but before the monster falls over.
simulated function PlayDying(class<DamageType> DamageType, vector HitLoc) { Super.PlayDying(DamageType, Hitloc); Spawn(class'ONSShockTankDeathExp'); Spawn(class'NewExplosionC'); }
I just chose some random Emitters to spawn. If you use these you will notice giant tires fly everywhere when the monster dies. Obviously these emitters are not a very good choice for a monster (please note that you need the ECE Bonus Pack installed in order to spawn the ONSShockTankDeathExp effect, you can download the bonus pack on my links page). Choose a suitable one or create your own!
You will also notice that although the monster spawns the effects he is still visible and plays his dying animation. If the monster has none it will just appear to be frozen. If you want the monster to vanish when it spawns the effects then we just need tweak our code a little bit. We need to add one extra line to make the monster be destroyed. We need to set the LifeSpan to a very low value like this.
simulated function PlayDying(class<DamageType> DamageType, vector HitLoc) { Super.PlayDying(DamageType, Hitloc); LifeSpan = 0.2; Spawn(class'ONSShockTankDeathExp'); Spawn(class'NewExplosionC'); }
Thats it! Your monster should stand out from the crowd now.
TIP – Don’t spawn too many effects at once or you might get “lag”. Limit the number of particles spawned as best you can.
Recent Comments