RealDocs

UAnimInstance::WasAnimNotifyStateActiveInAnyState

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

Description

Returns true if the specified AnimNotifyState type was active during the previous animation evaluation, regardless of which state machine state it came from. Provides a quick way to query global notify state presence without knowing the specific state or machine.

Caveats & Gotchas

  • This reflects the state from the previous frame's evaluation, not the current frame in progress. There is always a one-frame lag between a notify becoming active and this function returning true.
  • Returns true as long as the notify state overlaps the current animation position in any active state. During a blend transition, notify states from both the source and destination states may simultaneously contribute, potentially keeping this true longer than expected.

Signature

UFUNCTION(BlueprintPure, Category="Animation")
bool WasAnimNotifyStateActiveInAnyState(TSubclassOf<UAnimNotifyState> AnimNotifyStateType) const;

Parameters

Name Type Description Default
AnimNotifyStateType TSubclassOf<UAnimNotifyState> The class of anim notify state to check for.

Return Type

bool

Example

Check if a weapon-trail notify is active across any state C++
// In NativeUpdateAnimation
if (WasAnimNotifyStateActiveInAnyState(UNS_WeaponTrail::StaticClass()))
{
	MyWeapon->EnableTrailEffect(true);
}
else
{
	MyWeapon->EnableTrailEffect(false);
}

Version History

Introduced in: 4.8

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.