STEP1: Adjust the Player
- Open Object_Sampleplayer.
- Open BaseSettings, set HP and Max HP to 20, and set the blink interval (BlinkDuration) to 0.1 seconds. This makes the character blink during invincibility time, improving visibility.
- Next, add a new node called TakenDamageSettings.
- In TakenDamageSettings, various configurations can be made, but this time we will use it only to add a damage sound effect. Create a new damage setting, enable sound playback under OtherSettings, and set it to male_1_1_A.
- Perform a test play. When hit by an enemy, the character should play a damage sound and blink. However, it seems the player and zombies are pushing each other, so let’s fix this issue.
- Select the Player node. Change Collision > CollisionLayer from 1 to 2. Layer indicates the physical layer the object belongs to, while Mask indicates the layers it collides with. Since zombies have Layer 2 and Mask 1, setting the player to Layer 2 will prevent them from colliding with each other. *CollisionLayer/CollisionMask will be explained in detail in a separate manual.
- Now, the character has 20 HP, takes 1 damage when hit by an enemy, and becomes invincible for 1 second.
Explanation
What can be done with TakenDamageSettings.
You can configure damage multipliers when receiving attacks of specific attributes defined in the attack settings. This is useful for setting weaknesses and resistances. Additionally, hit stop can be configured, allowing effects such as slowing down for a short time after taking heavy damage.



