Physical Animations
Ninja Combat can use physical animations to create hit reactions when a combatant receives melee or ranged damage.
Physical animations blend regular animation with physics simulation, allowing a character to react to impact direction, hit strength, and affected bones without fully entering ragdoll. In Ninja Combat, this flow is handled by the Physical Animation Component, the Physical Animation Interface, and a Damage Handler that triggers reactions when damage is applied.
This feature is optional, but useful when characters should react physically to hits while still recovering back into animation.
Physical Animation Interface
All Combat System interactions with physical animations go through CombatPhysicalAnimationInterface.
This interface acts as a bridge between damage handling and the component that performs the physical reaction. Any component implementing this interface can provide physical animation behavior, which allows projects to replace or extend the default implementation.
Physical Animation Component
Ninja Combat provides NinjaCombatPhysicalAnimationComponent, which extends Unreal Engine's UPhysicalAnimationComponent and implements CombatPhysicalAnimationInterface.
The default component supports common hit reaction behavior, including reaction timing, blend weight, bone targeting, impact strength, follow-up hits, and debug output.
Add the Physical Animation Component
In your Character Blueprint or base class, add
NinjaCombatPhysicalAnimationComponent.Implement
GetPhysicalAnimationComponentfrom theCombatSystemInterface, returning the Physical Animation Component.
The default component provides the following features:
Feature | Description |
|---|---|
Designer-friendly settings | Reaction time, recovery, blend weight, and impact thresholds are exposed in the component defaults. |
Flexible bone targeting | Reactions can use the bone hit by the attack, a default bone, or a replacement from a bone mapping. |
Dynamic impulses | Impact direction and strength can be calculated from melee hits or projectiles. |
Follow-up handling | Follow-up hits can extend the reaction up to |
Debug support | Debug output can display information about each physical animation context. |
Physical Animation Profiles
Physical reactions use a Physical Animation Profile configured in the owner's Physics Asset.
When the component initializes, it retrieves the configured profile from the combat mesh and uses it when applying hit reactions.
Create a Physical Animation Profile
Open the Physics Asset assigned to the Skeletal Mesh that will play the physical animation.
In the Profiles tab, under Physical Animation Profiles, create a new profile named ImpactReaction, or use the name configured in the component.
Select the physics bodies that should participate in the impact reaction and add them to the current Physical Animation Profile.
Adjust the relevant physics bodies and constraints until the reaction feels appropriate for your character.
Physical animation quality depends heavily on the Physics Asset. Bodies, constraints, physical animation settings, and physics type all affect how the character transitions from animation into simulation and back again.
The Physics Type setting is especially important. It determines whether a body is kinematic, following animation, or simulated, participating in physics simulation.
Triggering Hit Reactions
Physical animation reactions are usually triggered from a Damage Handler configured in the character's Damage Data Asset.
The Physical Animation Damage Handler can react to melee or ranged damage and forward the impact context to the Physical Animation Component.
By default, the handler ignores recurring damage, such as damage effects that tick at an interval. If recurring damage should trigger physical reactions, enable that behavior in the handler settings.
For more information about Damage Data and Damage Handlers, see Damage and Mitigation.
Physical Animation Settings
The default component uses FCombatPhysicalAnimationSettings to configure how reactions behave.
You can find these settings in the Physical Animation Component's Defaults Panel.
Setting Area | Description |
|---|---|
Default Bone | Forces all impacts to react from a single bone, such as |
Bone Mapping | Redirects specific hit bones to other bones with valid physics bodies. Useful when simplifying Physics Asset setups. |
Reaction Times | Controls how long the reaction lasts, using |
In and Out Blending | Uses |
Strength Threshold | Ignores light hits below |
Debug Mode
To display debug information for each physical animation context, enable Debug Mode in the Physical Animation Component's Details Panel.
Debug Mode can help validate the selected bone, impact direction, impact strength, reaction time, and recovery behavior while tuning hit reactions.