In this lesson, you will learn how to bridge the gap between static animation and dynamic physics by setting up Physical Animation Profiles to allow your skeletal mesh to react to external forces while strictly following its current animation pose.
Understanding the Concept
Normally, when you play an animation, the mesh is "kinematic"—it ignores gravity and impacts. If you switch to a full Ragdoll, it becomes "dynamic"—it ignores the animation. A Physical Animation Profile acts as a middle ground. It tells Unreal Engine to use your Physics Asset to simulate forces, but it uses internal "springs" to force the bones back toward the transform dictated by your currently playing animation.
Setting Up the Profile
- Define the Profile: Open your
Physics Assetand locate the Physical Animation section in the details panel. Here, you create a new Profile name. - Configure Data: You must create a
Physical Animation Dataasset. This asset defines the strength of the "spring."- Orientation Strength: How hard the bone tries to match the animation’s rotation.
- Angular Velocity Strength: How much the physics engine resists the current motion (think of this as a dampener).
- Applying at Runtime: In your
Animation Blueprint, you use theSet Physical Animation Settingsnode. This allows you to toggle this "blended" behavior on or off for specific body parts (like an arm or leg) at runtime.
Why use this?
Imagine a character running while being hit by a small projectile. Without physical animation, the character plays a canned "hit" animation regardless of where the impact occurs. With Physical Animation, the specific bone hit by the projectile will realistically flinch or deflect based on the physics impact, then immediately snap back to the animation pose because of the Orientation Strength you configured.
// Logic flow for applying the profile
GetMesh()->SetAllBodiesBelowPhysicsBlendWeight("spine_01", 1.0f);
GetMesh()->SetPhysicalAnimationSettings("HitReactionProfile");
By tweaking the strength values, you can make your character look "stiff" (they barely react) or "loose" (they sway significantly with impacts), all while maintaining the high-fidelity movement of your animation clips.
Key Takeaway: Physical Animation Profiles create a procedural hybrid, allowing your skeletal mesh to remain tethered to your animation poses while physically reacting to the game world’s forces.