UAnimInstance::HasMarkerBeenHitThisFrame
#include "Animation/AnimInstance.h"
Access: public
Specifiers: UFUNCTIONBlueprintCallable
Description
Returns true if the given sync marker was passed during the current frame's animation evaluation in the specified sync group. Use this for frame-accurate event logic driven by sync markers, such as footstep audio or IK weight changes.
Caveats & Gotchas
- • The result is only valid during the same frame the marker is passed — it resets to false on the next tick. Unlike an AnimNotify, there is no queuing or persistent state; missed checks cannot be recovered.
- • Marked BlueprintThreadSafe but the marker pass is recorded during animation graph evaluation. Querying from game-thread code (e.g. Tick) after the animation has evaluated is valid, but querying before evaluation will read the prior frame's state.
Signature
UFUNCTION(BlueprintCallable, Category="Animation", meta=(BlueprintThreadSafe))
ENGINE_API bool HasMarkerBeenHitThisFrame(FName SyncGroup, FName MarkerName) const; Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| SyncGroup | FName | Name of the sync group to query. | — |
| MarkerName | FName | Name of the sync marker to check. | — |
Return Type
bool Example
Trigger footstep audio from a sync marker C++
void UMyAnimInstance::NativeUpdateAnimation(float DeltaSeconds)
{
Super::NativeUpdateAnimation(DeltaSeconds);
if (HasMarkerBeenHitThisFrame(FName("DefaultGroup"), FName("LeftFootDown")))
{
Character->PlayFootstepSound(EFoot::Left);
}
} See Also
Tags
Version History
Introduced in: 4.12
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?