Player Got Damage!- Game Dev Series 24

S.J. Jason Liu
May 19, 2021

--

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!

--

--

S.J. Jason Liu
S.J. Jason Liu

Written by S.J. Jason Liu

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

No responses yet