UAnimInstance::WasAnimNotifyTriggeredInStateMachine
#include "Animation/AnimInstance.h"
Access: public
Specifiers: UFUNCTIONBlueprintPure
Description
Returns true if a notify of the given class was triggered anywhere in the specified state machine during the last frame. Broader than WasAnimNotifyTriggeredInSourceState — does not restrict the check to a single source state.
Caveats & Gotchas
- • Searches all active states in the machine, including blended states during transitions. A notify in a state that has 0.01 blend weight will still return true.
- • MachineIndex must match the compiled index of the state machine; it is not the display name. These indices can shift if you reorder machines in the AnimBP, breaking the check silently.
Signature
UFUNCTION(BlueprintPure, Category="Animation")
bool WasAnimNotifyTriggeredInStateMachine(int32 MachineIndex, TSubclassOf<UAnimNotify> AnimNotifyType) const; Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| MachineIndex | int32 | Index of the state machine to query. | — |
| AnimNotifyType | TSubclassOf<UAnimNotify> | Class of the notify to check for. | — |
Return Type
bool Example
Detect a footstep notify anywhere in the locomotion machine C++
// MachineIndex 0 is the locomotion state machine in this AnimBP
bool bFootstep = WasAnimNotifyTriggeredInStateMachine(0, UAnimNotify_Footstep::StaticClass());
if (bFootstep)
{
SpawnFootstepDecal();
} See Also
Tags
Version History
Introduced in: 4.11
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?