Getting Enemies to explode when hit!

Brennen Witzens
2 min readApr 4, 2021
Bakoom!!!

Everyone has their own sense of aesthetics. Visuals and animations are something that are very high priority when it comes to a game. Making sure the animations link up properly when an enemy dies, or a cutscene plays when a player triggers something.

There are a few steps to set up an animation to properly link with everything. One: Getting the animation set up. It might seem like a “Well Duh” but it does take more than you think.

In this case I wasn’t clicked on anything but now you have the Dopesheet. This is where you would insert the keyframes for said animation. Make sure you’re clicked on the object you want to animate to be able to set up the proper animation(s).

Two: Setting the states. This is a simple Animatior map, since there are only 2 states. The Orange block is my “Idle/Normal” state for my enemy and the gray one is the Explosion. The arrow going from the orange block is a transition, using a trigger, to tell the enemy to play the explosion animation when it needs to.

Three: Fine Tuning. Making sure everything lines up and plays when it needs to is just as important as the other steps. In some instances, if it’s the only state the animation will loop. If I didn’t add the “Normal” state, the explosion would have just looped forever.

Next time, we’ll be talking about adding visuals to be able to start the game, and visuals to the player. On to the next then.

--

--