CombatHit Reaction Ability
Last modified: 13 October 2024Activated on each successful hit, even if damage was zero.
Supports a default animation and other animations specific to certain damage types.
Supports directional hit reactions, with a flexible calculation system.
The Hit Reaction Ability supports directional hit reactions and maps certain incoming damage types to specific animations. This ability is typically activated via Gameplay Events, so it should always be added to the character by default.
Directional Hit Reactions
The Hit Reaction Ability uses the Directional Hits Animation Provider, which can select a specific Animation Montage or Montage Section based on certain angle ranges:
In this example, the system uses the appropriate Montage Sections from the Animation Montage to play reactions based on the hit direction.
note
When using montage sections, make sure to break their links in the Montage Section panel. Otherwise, all sections will play in sequence!
Hit Angle Calculation
The Hit Reaction Animation Provider calculates the hit angle using two sources: the Hit Result Location and the Attacker Location. You can customize their influence using the Hit Location Weight and Attacker Location Weight properties.
This flexibility allows you to fully consider, fully ignore, or create a blended angle based on both sources. The following image illustrates this concept:
Contextual Hit Reactions
The Animation Provider also supports different Hit Reaction Contexts. These are mappings between Gameplay Tags in the incoming damage and specific Animation Montages.
In the example above, two contextual animations were set, one for knockback attacks and another one for stagger damage. The animations set to these contexts will also respect the main configuration for directional attacks.
tip
If no context matches the incoming damage, then the default Animation Montage set in the Animation Provider is used.
The Hit Reaction will determine the context by filtering Gameplay Tags present in the damage instigator and target, considering the Gameplay Tags set in the equivalent properties, Instigator Tags Filter and Target Tags Filter.