Unity Guide

IDamageable interface | Unity

A quick guide about how to implement an IDamageable interface in Unity

Current enemies

To start, let’s take a look at the enemies in our 2D game. Currently, we have a moss giant, a spider and a skeleton that patrol on certain areas of the level:

IDamageable interface

Now, in order to indicate that certain gameobjects are damageable (like our enemies), let’s create a new C# script named IDamageable:

Nerd For Tech

From Confusion to Clarification

Nerd For Tech

NFT is an Educational Media House. Our mission is to bring the invaluable knowledge and experiences of experts from all over the world to the novice. To know more about us, visit https://www.nerdfortech.org/.

Fernando Alcantara Santana

Written by

A passionate computer technology engineer and Unity developer that is always looking to grow in every aspect of life :).

Nerd For Tech

NFT is an Educational Media House. Our mission is to bring the invaluable knowledge and experiences of experts from all over the world to the novice. To know more about us, visit https://www.nerdfortech.org/.