RealDocs

UAnimInstance::GetLinkedAnimGraphInstancesByTag

function Engine Since 4.24
#include "Animation/AnimInstance.h"
Access: public Specifiers: ENGINE_API

Description

Populates an array with all linked anim graph instances whose graph node carries the specified tag, allowing bulk access to multiple sub-graphs sharing the same tag.

Caveats & Gotchas

  • Returns all instances matching the tag — there may be more than one if the anim graph fans out to several linked graphs with the same tag. Iterate the output array rather than assuming index 0 is the only result.
  • Linked anim graph instances are only created after the anim graph has been initialized. Calling this during construction or BeginPlay before InitializeAnimation has run will return an empty array.
  • Tags are set in the anim graph editor's Linked Anim Graph node properties and are not related to Actor tags or component tags — they are anim-graph-specific metadata.

Signature

ENGINE_API void GetLinkedAnimGraphInstancesByTag(FName InTag, TArray<UAnimInstance*>& OutLinkedInstances) const;

Parameters

Name Type Description Default
InTag FName The tag assigned to the linked graph node in the anim graph editor.
OutLinkedInstances TArray<UAnimInstance*>& Output array populated with all linked anim graph instances matching the given tag.

Return Type

void

Example

Broadcast a state change to all overlay graphs sharing a tag C++
TArray<UAnimInstance*> UpperBodyInstances;
AnimInstance->GetLinkedAnimGraphInstancesByTag(FName("UpperBody"), UpperBodyInstances);
for (UAnimInstance* LinkedInstance : UpperBodyInstances)
{
    if (UMyUpperBodyAnimInstance* Typed = Cast<UMyUpperBodyAnimInstance>(LinkedInstance))
    {
        Typed->SetAimingState(bIsAiming);
    }
}

Version History

Introduced in: 4.24

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.