UAnimInstance::PreUpdateLinkedInstances
#include "Animation/AnimInstance.h"
Access: public
Specifiers: virtual
Description
Called before linked animation instances are updated. Override to propagate shared state or synchronize variables from the main instance to linked instances before their update runs.
Caveats & Gotchas
- • Only called on the main animation instance, not on linked instances themselves. Linked instances receive their updates after this call completes.
- • This is called every frame before the linked instance update pass. Heavy work here directly increases animation update cost since it runs on the game thread before parallel evaluation begins.
Signature
virtual void PreUpdateLinkedInstances(float DeltaSeconds); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| DeltaSeconds | float | Time elapsed since the last animation update. | — |
Return Type
void Example
Push variables to linked instances C++
void UMyAnimInstance::PreUpdateLinkedInstances(float DeltaSeconds)
{
Super::PreUpdateLinkedInstances(DeltaSeconds);
// Push shared movement data to all linked anim instances
for (UAnimInstance* Linked : GetOwningComponent()->GetLinkedAnimInstances())
{
if (UMyLinkedAnimInstance* MyLinked = Cast<UMyLinkedAnimInstance>(Linked))
{
MyLinked->Speed = Speed;
MyLinked->bIsFalling = bIsFalling;
}
}
} Tags
Version History
Introduced in: 4.24
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?