RealDocs

UAnimInstance::ShouldExtractRootMotion

function Engine Since 4.0
#include "Animation/AnimInstance.h"
Access: public Specifiers: ENGINE_API

Description

Returns whether this anim instance should currently extract and apply root motion from its animations. The result depends on the skeletal mesh component's root motion mode setting and whether any active animations contain root motion data.

Caveats & Gotchas

  • This only indicates the anim instance's intent to extract root motion — the character movement component must also be configured to consume root motion for it to actually affect movement. A true return with ERootMotionMode::NoRootMotionExtraction on the movement component means root motion is extracted but discarded.
  • In linked anim graph setups, only the main anim instance typically extracts root motion. Linked instances return false unless explicitly configured to contribute root motion through the linked graph settings.

Signature

ENGINE_API bool ShouldExtractRootMotion() const;

Return Type

bool

Example

Conditionally apply root motion logic C++
void UMyAnimInstance::NativeUpdateAnimation(float DeltaSeconds)
{
	Super::NativeUpdateAnimation(DeltaSeconds);
	if (ShouldExtractRootMotion())
	{
		// Root motion is active — disable manual velocity override
		bUseManualVelocity = false;
	}
}

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.