RealDocs

UAnimInstance::UpdateAnimation

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

Description

Main entry point for the game-thread animation update. Advances state machines, evaluates transition rules, and calls NativeUpdateAnimation and BlueprintUpdateAnimation. Called automatically each frame by the skeletal mesh component.

Caveats & Gotchas

  • • Do not call this directly — the skeletal mesh component's tick drives it. If you need to inject custom update logic, override NativeUpdateAnimation instead.
  • • This runs on the game thread. The parallel update (ParallelUpdateAnimation) runs separately on a worker thread after this completes. Variables read during the parallel phase should be set here.

Signature

ENGINE_API virtual void UpdateAnimation(float DeltaSeconds, bool bNeedsValidRootMotion);

Parameters

Name Type Description Default
DeltaSeconds float Time elapsed since the last animation update. —
bNeedsValidRootMotion bool Whether the caller requires valid root motion data this frame. —

Return Type

void

Example

Typical lifecycle (no direct call needed) C++
// UpdateAnimation is called automatically. Override NativeUpdateAnimation instead:
void UMyAnimInstance::NativeUpdateAnimation(float DeltaSeconds)
{
    Super::NativeUpdateAnimation(DeltaSeconds);
    Speed = GetOwningComponent()->GetComponentVelocity().Size();
}

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.