Ninja Bear Studio Plugins Help

Physical Animations

Combat systems commonly use physical animations for hit reactions. Ninja Combat provides this functionality via its Physical Animation Component and Damage Handler.

Physical Animation Interface

All interactions with the Physical Animation Component happen through the CombatPhysicalAnimationInterface, which acts as a bridge between the Combat System and any implementation of physical reactions.

Physical Animation Component

The Combat System provides its own Physical Animation Component, which extends UPhysicalAnimationComponent, Unreal Engine's default system for blending physics simulation and animation. Implements the CombatPhysicalAnimationInterface.

Adding the Physical Animation Component

  1. In your Character Blueprint or Base class, add NinjaCombatPhysicalAnimationComponent.

  2. Implement GetPhysicalAnimationComponent from the CombatSystemInterface, returning the Physical Animation Component.

The default Physical Animation Component provided by Ninja Combat also provides the following features:

  • Designer-Friendly Setup: Impact reaction time, recovery and blend weight are all exposed in the component's default settings.

  • Flexible Bone Targeting: Reactions can happen from specific bones hit during an attack or others selected from a replacement mapping.

  • Dynamic Impulses: Direction calculated from trace, scaled by incoming strength, from melee weapons or projectiles.

  • Follow-up handling: Follow-up hits add time up to MaxReactionTime, better supporting fast combos and avoiding "physics lock".

  • Debug Support: On-screen and log info about each hit, toggleable via bEnableDebugMode.

Physical Profiles

When a physical reaction is activated, it will use a specific Physical Animation Profile set in the owner's combat mesh, which is retrieved and stored on BeginPlay.

Creating a Physical Animation Profile

  1. Open the Physics Asset assigned to the Skeletal Mesh that will play the physical animation.

  2. In the Profiles tab, under Physical Animation Profiles, create a new profile in the Current Profile box. Name it ImpactReaction to match the component setting.

  3. With the new profile enabled, select all physics bodies relevant to the Impact simulation, and add them to the current physical animation profile.

  4. Adjust your physics bodies and their constraints so they react correctly for your scenario, this varies case-by-case.

To work with Physical Animation Profiles, it is important to understand how the Physics Asset, its bodies and constraints are configured. In particular, settings under Physical Animation, that are enabled when a body is added to the profile.

Another important element is the Physics Type, present under the Physics category. This allows you to determine if the body is kinematic (follows animation) or simulated (executes physics simulation).

With these settings you can fine-tune your Physical Animations so they can transition nicely from animation to physics simulation, in any context supported by your game. You can find more information about this in the list of references.

Triggering Impact Animations

In Ninja Combat, you can define what happens when a character takes damage, via the Damage Data Asset asset, and its list of Damage Handlers.

The Physical Animation handler can be used to trigger the Physical Animation on a character, when any melee or ranged damage is applied.

By default, the Damage Handler will not execute from recurring damage - which are recurring effects set to a given interval. If such reactions are desirable, then they be enabled via the handler's exposed properties.

Physical Animation Settings

The default Physical Animation system uses FCombatPhysicalAnimationSettings to store the context for an animation. The table below shows possible adjustments that can be obtained from this data structure.

Adjustment

Details

Default Bone

Forces all impacts to react from a single bone (e.g. Spine_02). Use when precision is not needed.

Bone Mapping

Redirects specific bones (e.g. Pelvis) to valid ones with physics bodies. Useful for simplifying setups.

Reaction Times

Adjust how long the simulation lasts: use DefaultReactionTime for initial hits, FollowUpReactionTime for combos, and MaxReactionTime as a ceiling.

In/Out Blending

Use MaxBlendWeight for full simulation, and KinematicInterpSpeed to control how fast the character recovers to animation.

Strength Threshold

Ignore light hits below MinImpactStrengthThreshold. Scale response between min and MaxImpactStrength.

You can find these settings in the Physical Animation Component's Defaults Panel.

Debug Mode

To enable a visual display of each physical animation context, enable Debug Mode in the component's Details Panel.

Last modified: 04 June 2025