Player Got Damage!- Game Dev Series 24

Objective: Create damage animation to player.

Previous: Creating Enemy Explosions

Since our Player has 3 chances before game over, we can create the damage animation in each step to show how dangerous our Player is.

Drag in first sprite of Player_Hurt animation to hierarchy and adjust the size. Create an animation with this game object.

Rename it as Right_Damage and drag it under Player as a child. Then adjust the position to right engine.

Duplicate this as Left_Damage, and set these game object as disable. Then we can create some code to active these 2.

Inside the Player script, as usual we need to create variables to the game object. Then under the lives calculation, active the specific damage effect due to lives count.

Press Play and watch our player get hurts!



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
S.J. Jason Liu

S.J. Jason Liu


A passionate gamer whose goal is to work in video game development.