UAnimInstance::GetLinkedAnimLayerInstancesByGroup
#include "Animation/AnimInstance.h"
Access: public
Specifiers: UFUNCTIONBlueprintPure
Description
Collects all distinct linked anim instances that are running for the specified layer group. For grouped layers this typically returns one instance; for ungrouped (NAME_None) layers it returns one per ungrouped node.
Caveats & Gotchas
- • The returned array may contain duplicates in some graph topologies (e.g. a single instance referenced by multiple layer nodes in the same group). If uniqueness matters, deduplicate OutLinkedInstances before use.
- • OutLinkedInstances is not cleared before population — append semantics can cause stale data if you reuse the array across calls. Ensure you clear it or pass a fresh array each time.
Signature
ENGINE_API void GetLinkedAnimLayerInstancesByGroup(FName InGroup, TArray<UAnimInstance*>& OutLinkedInstances) const; Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| InGroup | FName | Group name to search. Pass NAME_None to retrieve all ungrouped layer instances. | — |
| OutLinkedInstances | TArray<UAnimInstance*>& | Receives the distinct linked instances found for the group. | — |
Return Type
void Example
Iterating all ungrouped layer instances to propagate state C++
TArray<UAnimInstance*> UngroupedInstances;
GetLinkedAnimLayerInstancesByGroup(NAME_None, UngroupedInstances);
for (UAnimInstance* Inst : UngroupedInstances)
{
if (UMyLayerAnimInstance* LayerAnim = Cast<UMyLayerAnimInstance>(Inst))
{
LayerAnim->UpdateSharedState(SharedAnimData);
}
} Tags
Version History
Introduced in: 4.24
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?