Skeleton Damage Animation

Making our Skeleton Enemy respond to sword attack

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.

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

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Native Extensions for Node.js

HTML codes in WordPress

Day 6 of Coding/Learning

Communicating with MongoDB using TCP Sockets

Intersection of Two Arrays II— Leetcode #350

BlogPost_203

Uploading image/ file and text using React(hooks)-Redux with multer: PART 1

Saleor and Next.js: How the two are a powerhouse combination

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Simon Truong

Simon Truong

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

More from Medium

Death Animation

Galaxy Shooter 2D — New Enemy Behavior (Follow)

What are “Render Pipelines” in Unity?

Prefabs in Level Design