UAnimInstance::NativeThreadSafeUpdateAnimation
#include "Animation/AnimInstance.h"
Access: protected
Specifiers: virtualENGINE_API
Description
Called each frame on the worker thread to update animation state in a thread-safe context. Override this in C++ subclasses to compute variables used by the anim graph without blocking the game thread.
Caveats & Gotchas
- • Runs on a worker thread — you must not access game-thread-only data (e.g., spawning actors, modifying components) from this function. Only read thread-safe properties cached during NativeUpdateAnimation.
- • The Blueprint equivalent is BlueprintThreadSafeUpdateAnimation. If both are overridden, the native version runs first.
Signature
virtual void NativeThreadSafeUpdateAnimation(float DeltaSeconds) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| DeltaSeconds | float | Time elapsed since the last animation update, in seconds. | — |
Return Type
void Example
Thread-safe velocity caching C++
void UMyAnimInstance::NativeThreadSafeUpdateAnimation(float DeltaSeconds)
{
Super::NativeThreadSafeUpdateAnimation(DeltaSeconds);
// Only use cached, thread-safe data here
GroundSpeed = FMath::FInterpTo(GroundSpeed, CachedSpeed, DeltaSeconds, 10.f);
} Tags
Version History
Introduced in: 5.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?