RealDocs

UAnimInstance::IsSyncGroupBetweenMarkers

function Engine Blueprint Since 4.12
#include "Animation/AnimInstance.h"
Access: public Specifiers: UFUNCTIONBlueprintCallable

Description

Returns true if the sync group's current playback position is between the two named markers. Useful for gating gameplay logic to a specific window within a looping animation, such as when the character's foot is planted.

Caveats & Gotchas

  • When bRespectMarkerOrder is false, the function only checks that the current position is between the two markers regardless of which was defined first in the asset — useful for reverse-playback scenarios but can produce unexpected results on forward playback.
  • Both markers must exist in the leader animation of the sync group. If either is missing the function returns false without a warning; always verify marker names match the animation asset exactly.

Signature

UFUNCTION(BlueprintCallable, Category="Animation", meta=(BlueprintThreadSafe))
ENGINE_API bool IsSyncGroupBetweenMarkers(FName InSyncGroupName, FName PreviousMarker, FName NextMarker, bool bRespectMarkerOrder = true) const;

Parameters

Name Type Description Default
InSyncGroupName FName Name of the sync group to query.
PreviousMarker FName Name of the marker that was most recently passed.
NextMarker FName Name of the marker that is next to be reached.
bRespectMarkerOrder bool If true, the markers must appear in the given order in the animation. true

Return Type

bool

Example

Enable foot IK only when the foot is between plant markers C++
bool bLeftFootPlanted = IsSyncGroupBetweenMarkers(
    FName("DefaultGroup"),
    FName("LeftFootDown"),
    FName("LeftFootUp"));
LeftFootIKAlpha = bLeftFootPlanted ? 1.0f : 0.0f;

Version History

Introduced in: 4.12

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.