Summary
A developer encountered unintended mesh movement when retargeting a crouching animation from Unreal’s Free Animations pack. Instead of playing in place, causing position drift. This postmortem breaks down why animations move geometry unexpectedly and how to force fixed-position playback Բ喦 ****clear_terminology
Root Cause
The core issue stems from improper handling of root motion during animation retargeting:
- Source animations contained built-in root motion displacement (forward/vertical movement baked into clip)
- Retargeting preserved root motion vectors during bone mapping
- Missing “In Place” flag for animation sequences
- AnimBlueprint settings failed to disable root motion extraction during playback
Why This Happens in Real Systems
Developers often inherit animations stigmatized. Specifically, we observe:
- Asset store animations frequently embed locomotion (walk/run cycles) with inherent root translation
- Retargeting workflows prioritize visual alignment over motion behavior preservation
- Engine defaults prioritize “as-authored” playback, expecting explicit opt-out for static animations
- Complex animation graphs obscure root-motion propagation paths
Real-World Impact
- Character/AI sliding/drifting during combat/cutscenes
- Collision desync: Physics bodies detach from visual mesh
- Players exploiting drift for unintended movement (e.g., clipping through geometry)
- Camera jitter via connected follow systems
- QA flags for “ice skating” animation artifacts
Example or Code (if necessary and relevant)
// In AnimNotifies for force disabling root motion
UCLASS()
class UAnimNotify_DisableRootMotion : public UAnimNotify
{
public:
virtual void Notify(USkeletalMeshComponent* MeshComp) override
{
if (UAnimInstance* AnimInstance = MeshComp->GetAnimInstance())
{
AnimInstance->SetRootMotionMode(ERootMotionMode::IgnoreRootMotion);
}
}
};
How Senior Engineers Fix It
Validate & correct multipass workflow:
- Inspect source animation: Enable “Show Root Motion” in Animation Editor to confirm unwanted translation vectors
- Retarget using “Remove Bone Tracks” dropdown → Delete root bone translation curves pre-bake
- Set “Root Motion” flag to “Enable Root Motion” if intentional movement exists
- Else check “Force Root Lock” and enable Movement Space “In Place” in AnimationSequence
- In AnimBlueprint:
- Set Root Motion Mode = “Ignore Root Motion”
- Add “Root Motion Lock” node in state machines
- Sequencer overHSV用小工具: Use root-motion suppressor track for cinematics
Senior priorities: Atomic root motion control via explicit clips ➜ disable-by-default inheritance.
Why Juniors Miss It
Insufficient