Skeleton Damage Animation

Making our Skeleton Enemy respond to sword attack

Simon Truong
2 min readDec 6, 2021

--

Since we are working with the Attack Sequence for the player, we might as well add in some player feedback when the enemies are being hit by the player sword. To achieve this we are going to use an Hit Animation that will be triggered during any state and toggled by the On Trigger Event of the hitbox component.

Prepping the Hit Animation:

Following the same procedure since we have started this project, by importing the animation sheet and slicing it according to the cell size. Then Create a new animation state for the Skeleton and call the animation “Hit”. Drag and drop the entire Hit animation sequence into the dope sheet so we can have a proper hit animation.

Set the Frame rate to 20 if you find that the animation is too quick.

In the Animator window we are going to create a new parameter Trigger called “Hit” and this will be the condition to toggle the animation. Since being hit can happen during any state of the Skeleton animation cycle, we can use the “Any State” state for the transition.

Make sure to set the condition to the Trigger “Hit”.

In the next article we will learn how to use Another type of object orient scripting called polymorphism that brings the damage function into the our game.

--

--

Simon Truong

A Designer, an Illustrator and a massive tech geek aspiring to become a professional Unity Developer.