RealDocs

ACharacter::SetAnimRootMotionTranslationScale

function Engine Since 4.8
#include "GameFramework/Character.h"
Access: public

Description

Sets a runtime multiplier applied to all animation root motion translation for this character. Use this to scale, suppress, or amplify root motion movement without modifying the animation asset.

Caveats & Gotchas

  • `AnimRootMotionTranslationScale` is a replicated property. Setting it on the server replicates to all clients, so changes are authoritative across the network. Setting it only on the client will be overwritten on the next replication tick.
  • The scale applies only to translation (XYZ displacement). Rotation from root motion is unaffected. If you need to scale rotation as well, you must handle that separately in the movement component.
  • Setting this to 0 does not disable root motion entirely — the animation still drives rotation and the movement mode remains in root motion. To fully disable root motion, change the animation's `RootMotionMode` or use `ServerMoveIgnoreRootMotion`.

Signature

ENGINE_API void SetAnimRootMotionTranslationScale(float InAnimRootMotionTranslationScale = 1.f)

Parameters

Name Type Description Default
InAnimRootMotionTranslationScale float Multiplier applied to all root motion translation. 1.0 is full motion, 0.0 suppresses translation entirely. 1.f

Return Type

void

Example

Suppress root motion translation during a stagger C++
void AMyCharacter::ApplyStagger()
{
	// Freeze positional root motion so only rotation plays
	SetAnimRootMotionTranslationScale(0.f);
}

void AMyCharacter::RecoverFromStagger()
{
	SetAnimRootMotionTranslationScale(1.f);
}

Version History

Introduced in: 4.8

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.