RealDocs

UCharacterMovementComponent::ConvertLocalRootMotionToWorld

function Engine Since unknown
#include "GameFramework/CharacterMovementComponent.h"
Access: public Specifiers: ENGINE_API

Description

Takes a root motion delta transform captured in component space and converts it into a world-space transform, running any bound ProcessRootMotionPreConvertToWorld/ProcessRootMotionPostConvertToWorld delegates around the conversion.

Caveats & Gotchas

  • The pre- and post-conversion delegates (ProcessRootMotionPreConvertToWorld, ProcessRootMotionPostConvertToWorld) are the intended extension point for modifying root motion — most games hook these instead of overriding this function.
  • Only meaningful while HasAnimRootMotion() is true; calling it outside that context operates on stale or default RootMotionParams data.
  • The conversion accounts for the character's current world rotation, so calling it with an already-world-space transform will double-apply orientation.

Signature

FTransform ConvertLocalRootMotionToWorld(const FTransform& InLocalRootMotion, float DeltaSeconds)

Parameters

Name Type Description Default
InLocalRootMotion const FTransform& Root motion delta transform expressed in component (mesh) space.
DeltaSeconds float Elapsed time for the current move, passed through to the pre/post conversion delegates.

Return Type

FTransform

Example

Hooking the conversion delegates C++
void AMyCharacter::BeginPlay()
{
    Super::BeginPlay();
    GetCharacterMovement()->ProcessRootMotionPreConvertToWorld.BindLambda(
        [](const FTransform& InTransform, UCharacterMovementComponent*, float)
        {
            // Inspect or modify InTransform before world-space conversion
            return InTransform;
        });
}

Version History

Introduced in: unknown

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.