Boss Fight Implementation Part 6: On Death Behavior

Jared Amlin
4 min readOct 28, 2021

--

The boss in my Unity project here is doing everything but dying when it’s health expires. My objective for this article is to give my boss some on death behavior and display some game over text routine.

I start by making a copy of my Boss Prefab and deleting most of the components. This prefab will be instantiated by the boss at it’s own position, after it has “died”, and just before it destroys itself.

I name the prefab game object Dead_Anglerfish, and then assign it’s color to be red in the Sprite Renderer.

The Rigidbody 2D gets a Gravity Scale of 1, which will make it fall slowly downwards off the game scene. It also gets two script components. One for the main movement behavior, and another to give it a slow rotation.

--

--

Jared Amlin

I am an artist and musician, that is currently diving headfirst into game development with C# and Unity3D.