RealDocs

UAnimInstance::GetSyncGroupIndexFromName

function Engine Since 4.15
#include "Animation/AnimInstance.h"
Access: public Specifiers: const

Description

Returns the internal index for a named sync group. Sync groups coordinate playback timing across multiple animation assets so they stay in phase — this index is used to access the sync group's runtime data for queries or debugging.

Caveats & Gotchas

  • Returns INDEX_NONE if the sync group name does not match any active sync group in this anim instance. Sync groups are only created when animations that reference them are actually playing.
  • Sync group indices can change between frames as groups are created and destroyed dynamically. Do not cache the index across frames — re-query each time you need it.

Signature

int32 GetSyncGroupIndexFromName(FName SyncGroupName) const

Parameters

Name Type Description Default
SyncGroupName FName The name of the sync group to look up.

Return Type

int32

Example

Look up a sync group index C++
void UMyAnimInstance::CheckSyncGroup()
{
    int32 GroupIndex = GetSyncGroupIndexFromName(FName("LocomotionSync"));
    if (GroupIndex != INDEX_NONE)
    {
        UE_LOG(LogAnimation, Log, TEXT("Sync group 'LocomotionSync' active at index %d"), GroupIndex);
    }
}

Version History

Introduced in: 4.15

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.