UAnimInstance::ConsumeExtractedRootMotion
#include "Animation/AnimInstance.h"
Access: public
Description
Returns the root motion accumulated this frame, scaled by Alpha, and removes it from the anim instance so it isn't applied twice.
Caveats & Gotchas
- • Destructive read: calling it twice in the same frame returns empty root motion the second time because the internal accumulator is cleared on consumption.
- • Alpha is typically the root motion montage's blend weight, not a general-purpose multiplier — passing 1.0 unconditionally can double-apply motion when other systems already blend it.
- • Root motion must have been extracted earlier in the same update via the animation graph's root motion nodes; calling this before that step returns a zeroed FRootMotionMovementParams.
Signature
FRootMotionMovementParams ConsumeExtractedRootMotion(float Alpha) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| Alpha | float | Blend weight to scale the returned root motion transform by (1.0 = full root motion). | — |
Return Type
FRootMotionMovementParams Example
Consuming root motion in a character movement component C++
if (UAnimInstance* AnimInstance = GetMesh()->GetAnimInstance())
{
FRootMotionMovementParams RootMotion = AnimInstance->ConsumeExtractedRootMotion(1.0f);
if (RootMotion.bHasRootMotion)
{
const FTransform WorldSpaceRootMotion = RootMotion.GetRootMotionTransform();
// Apply WorldSpaceRootMotion to the pawn
}
} Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?