Ninja Bear Studio Plugins Help

React to Fatal Damage

Continuing the damage handling, we will handle fatal damage, which starts the death flow and activates the Death Ability.

Configure the default death animation

  1. For the default death reaction, we will use directional animations. Create an Animation Montage and organize all the sequences.

  2. Create Montage Sections for each sequence, with appropriate names, based on their directions.

  3. Add a looping section where the ability is in a static pose, it will ensure that the character never resets to the wrong stance.

  4. Organize all montage sections so main sections go into their static parts, which will then loop into themselves.

  5. Add the Ragdoll and the Death notifies in the appropriate frames..

Default Death Animation Montage

Configure the strong death animation

  • For the strong death reaction, repeat the same steps as before.

Strong Death Animation Montage

Configure the Death Gameplay Ability

  1. Create a new Gameplay Ability extending on CombatAbility_Death.

  2. Change the Animation Provider to Directional Hits.

  3. Adjust the Hit Location Weight and Attacker Location Weight if necessary.

  4. Map the direction ranges to the correct animation sections, you can add, remove or completely change the ranges as needed.

  5. Set the default Animation Montage and default Montage Section.

  6. The Cancel Abilities With Tag should be correct, but feel free to adjust these Gameplay Tags if you need. This container is used to indicate abilities that should be cancelled when the death ability activates.

  7. Add Combat.State.Opportunity.Victim to your list of Activation Blocked Tags. This should avoid conflicts between the Death Animation and the Opportunity System.

  8. Add the new Gameplay Ability to the Ability Data Asset created for the enemy character, so it is added by default.

Death Gameplay Ability

Update the Damage Data Asset

  1. Navigate to the Damage Data Asset created and assigned to the enemy in the previous guide.

  2. Set the Death Time Limit to 5.0. This will ensure that the character is destroyed even if something goes wrong in the Death Ability or Animation Notify.

  3. Add the Dissolve Handler which will update the defined material parameters, in all character meshes, based on the provided curves

The material used has two parameters: Dissolve and Dissolve Emissive, each one with their own float curve.

Damage Data Asset

Curves are value over time and may start at zero or have a delay

Dissolve Curve Example

Test everything

  1. Press play and attack the enemy.

  2. You should see the Hit Reactions from the previous guide.

  3. On fatal damage, the enemy should play the appropriate death animation, considering the damage direction.

  4. If fatal damage is applied from a heavy attack, the appropriate animation for strong attacks should be used.

Results
Last modified: 25 October 2024