Ninja Bear Studio Plugins Help

React to Player Damage

To make sure that our attacks work, we need an enemy. Using concepts established before, we will create a new enemy character that properly reacts to incoming damage and eventually dies.

Configure the default hit reaction animation

  1. For the default hit 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. In the Montage Sections tab, make sure to break the links between all sections, so they won't play in a sequence.

Default Hit Reaction Animation Montage

Configure the strong hit reaction animation

  • Create an Animation Montage for the heavy hit reaction.

Knockback Hit Reaction Animation Montage

Configure the hit reaction ability

  1. Create a Gameplay Ability from CombatAbility_HitReaction.

  2. Add a new entry to Hit Reaction Contexts for Combat.Effect.Damage.Knockback. Add the heavy hit animation to it.

  3. Add a new entry to Hit Reaction Contexts for Combat.Effect.Damage.Stagger. Add the heavy hit animation to it.

  4. Adjust the animation directions, so they use the appropriate montage sections.

  5. Set the Default Animation Montage and Default Section Name that will be used when no direction is set, or a direction entry cannot be found.

Hit Reaction Gameplay Ability

Configure the enemy Ability Data

  1. As done before, create a new Attribute Set Data Table that will be used to initialize the Combat Attribute Set.

  2. Create a new GAS Setup Data Asset for the enemy.

  3. Add the Combat Attribute Set and initialize it with the Attribute Table.

  4. Add the Hit Reaction Ability to the list of Default Gameplay Abilities.

Hit Reaction Gameplay Ability

Configure the enemy Damage Data

  1. Create a new Data Asset based on NinjaCombatDamageDataAsset.

  2. Set the Death Time Limit to 5.0, to accommodate longer animations.

  3. Add a new entry to the list of Damage Handlers and register a Combat Interfaces handler. It will trigger reactions in the weapons, such as their sound and particles.

Hit Reaction Gameplay Ability

Configure the enemy Blueprint

  1. Create a new blueprint for the enemy. This blueprint should inherit from NinjaGASCharacter.

  2. As done before, Add the Combat Manager Component as before, implementing the appropriate interface methods.

  3. Add the Damage Data to the Combat Manager.

  4. Add the Ability Data to the Ability System Component.

  5. Make sure that the enemy's capsule collision is set to ignore the weapon channel Also make sure that the enemy's mesh is set to block it.

Enemy Blueprint

Test everything

  1. Place your enemy blueprint in the map.

  2. Press play and attack the enemy, your hit reactions should be played.

Enemy Blueprint
Last modified: 25 October 2024