Day 121 — Implementing Death Animations for the Player and Enemies

Moss Giant
Skeleton
Spider
protected bool isDead = false;public virtual void Update()
{
if (anim.GetCurrentAnimatorStateInfo(0).IsName("Idle") && anim.GetBool("InCombat") == false)
{
return;
}
if (isDead == false)
{
Movement();
}

}
public void Damage()
{
Health--;
if (Health < 1)
{
isDead = true;
anim.SetTrigger("Death");
}

}

--

--

--

Hey and welcome! My name is Connor and my goal here is to put out a daily post for a full year about my game development journey.

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

Recommended from Medium

Bootstrap-the most popular CSS Framework

A Byte of Coding Issue #129

What do we do with all the managers now that we’re all meant to be self-managing teams?

AWS Serverless Progressive Web Apps

Application Security Models

How to fix a skewed document photo in Salesforce Apex

Implement public key pinning in Swift using TrustKit

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
Connor Fullarton

Connor Fullarton

Hey and welcome! My name is Connor and my goal here is to put out a daily post for a full year about my game development journey.

More from Medium

Generating video game loot — failure to success

The simplest way to create a First Person Shooter! (Part 3)

Creating a triple shot for my Player

Galaxy Shooter 2D — Completed Boss Fight + Game