RealDocs

UAnimInstance::WasAnimNotifyTriggeredInAnyState

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

Description

Returns true if a notify of the given class was triggered anywhere across all state machines in this AnimInstance during the last frame. The broadest of the WasAnimNotifyTriggered family — use it when you do not care which machine or state fired the notify.

Caveats & Gotchas

  • Because this scans all state machines, a notify triggered in a low-priority or nearly-blended-out machine will still return true. Use the machine- or state-scoped variants when you need finer control.
  • The check is frame-local: binding logic to this in AnimGraph thread-safe code and game-thread code in the same frame can produce inconsistent results due to evaluation ordering.

Signature

UFUNCTION(BlueprintPure, Category="Animation")
bool WasAnimNotifyTriggeredInAnyState(TSubclassOf<UAnimNotify> AnimNotifyType) const;

Parameters

Name Type Description Default
AnimNotifyType TSubclassOf<UAnimNotify> Class of the notify to check for.

Return Type

bool

Example

Trigger a camera shake on any hit-impact notify C++
void UMyAnimInstance::NativeUpdateAnimation(float DeltaSeconds)
{
    Super::NativeUpdateAnimation(DeltaSeconds);
    if (WasAnimNotifyTriggeredInAnyState(UAnimNotify_HitImpact::StaticClass()))
    {
        // Notify game code that an impact notify fired
        bImpactNotifyFiredThisFrame = true;
    }
}

Version History

Introduced in: 4.11

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.