# Apply Damage, Hit Reactions, and Death

> For the complete documentation index, see [llms.txt](llms.txt).

Make a practice opponent flinch when a hit leaves it standing and play a different animation when its health runs out. Start with a [melee hit](cbt-guide-melee-attacks.html) or [projectile](cbt-guide-ranged-attacks.html) that already reaches the target.

Procedure: Set up one repeatable hit

1. On the attack, use a Gameplay Effect based on `CombatEffect_MeleeHit` or `CombatEffect_RangedHit`. These use the damage execution. For a predictable first test, give the attacker positive Base Damage, turn off critical-hit chance, and give the target enough health to survive the first hit.

2. Use the provided Defense Data and Damage Data as starting points. Duplicate them into your project before editing. Assign both on the target's Combat Manager. Keep the Death outcome enabled. For this test, omit survival and knockdown outcomes so reaching zero health follows the death path.

Procedure: Give the target two reactions

1. Grant the target an ability based on `CombatAbility_HitReaction`. Assign a hit reaction montage and make sure its Slot exists in the target's Animation Blueprint. To distinguish front and back hits, add separate montage sections, unlink them from one another, and map the directions in the hit reaction animation provider.

2. Grant `CombatAbility_Death` with a death montage on the same full-body Slot. Add the Death notify at the frame where the dying sequence should finish. Keep the test target idle so another ability does not block a routine hit reaction.

For a localized impact, add `NinjaCombatPhysicalAnimationComponent` and return it from `GetPhysicalAnimationComponent`. Give the target's Physics Asset an ImpactReaction physical animation profile with the bodies that should respond, and include the physical-animation damage cosmetic in Damage Data.

For a custom shield rule, override `ApplyMitigation` in a Ninja Combat Damage Mitigation subclass and insert it in Defense Data. To add a consequence after damage resolves, override `HandleDamage` in a Ninja Combat Damage Outcome subclass and put it in Damage Data. In C++ the corresponding overrides are `ApplyMitigation_Implementation` and `HandleDamage_Implementation`. For a score or cleanup event, bind to the target's Owner Died or Owner Finished Dying delegate.

To show a damage number, bind `DynamicOnDamageReceived` on the Combat Manager and break the damage entry to read the result. A custom damage manager can expose the same notification through `BindToDamageReceivedDelegate`. Unbind when a widget stops watching that combatant.

![Hit Gameplay Effect with the damage execution configured](Documentation/cbt_guide_damage_gameplay_effect.png)

## Try It in Play

Land one hit and check that health falls and the target plays the surviving reaction. Repeat until the hit is fatal. Check that death begins once and that the finish notification arrives at the intended frame. If health falls but nothing plays, check the granted reaction ability, its animation provider, and the Slot.

