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

Optimistic Offline-First Apps With Vuex

Real-Time Object Detection using ml5.js and React

How to change the href value of “a” tag dynamic in Oracle APEX

Using ChartJS and React hooks to create a line chart related to an API

Nested JSON Values to CSV with JQ

10 Important Concepts in JavaScript Functional Programming for Enhanced Product Development | Part…

My experience with Ref in React native

Interviewer: Please Tell Me the Difference Between Slice, Splice, and Split?

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

Adding a User Interface to our prototype

Mobile Game Progression

Adding Emissions to Custom Textures

Ease Of Building UI Elements In Unity