RealDocs

UAnimInstance::NativeLinkedAnimationLayersInitialized

function Engine Since 5.0
#include "Animation/AnimInstance.h"
Access: protected Specifiers: virtualENGINE_API

Description

Called after all linked animation layer instances have been initialized and are ready to use. Override this to perform setup that depends on linked layers being available, such as caching references to layer instances.

Caveats & Gotchas

  • Linked layers may be initialized lazily or re-initialized at runtime if SetLinkedAnimClass is called. This callback fires each time, so guard against re-initialization side effects.
  • At the time this fires, the linked layer anim instances are valid, but they may not have ticked yet — do not read animation state from them until the next frame.

Signature

virtual void NativeLinkedAnimationLayersInitialized()

Return Type

void

Example

Cache a reference to a linked layer instance C++
void UMyAnimInstance::NativeLinkedAnimationLayersInitialized()
{
	Super::NativeLinkedAnimationLayersInitialized();
	UpperBodyLayer = Cast<UUpperBodyAnimInstance>(
		GetLinkedAnimGraphInstanceByTag(FName("UpperBody")));
}

Version History

Introduced in: 5.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.