UAnimInstance::WasAnimNotifyNameTriggeredInSourceState
#include "Animation/AnimInstance.h"
Access: public
Specifiers: UFUNCTIONBlueprintPure
Description
Returns true if a notify with the given name was triggered during the last frame while the specified state was the source state of a transition. Identical to WasAnimNotifyTriggeredInSourceState but matches by name rather than by class, which covers AnimNotify_PlaySound and other asset-based notifies.
Caveats & Gotchas
- • Name-based lookup is more fragile than class-based lookup — a rename of the notify asset breaks the check silently at runtime without any compile error.
- • Only valid for the single frame the notify fires; the result resets to false on the next tick regardless of whether a transition was taken.
Signature
UFUNCTION(BlueprintPure, Category="Animation")
bool WasAnimNotifyNameTriggeredInSourceState(int32 MachineIndex, int32 StateIndex, FName NotifyName) const; Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| MachineIndex | int32 | Index of the state machine to query. | — |
| StateIndex | int32 | Index of the source state within the machine. | — |
| NotifyName | FName | Name of the notify to check for. | — |
Return Type
bool Example
Check a named notify in a transition rule C++
bool UMyAnimInstance::CanExitReload(int32 MachineIndex, int32 StateIndex)
{
return WasAnimNotifyNameTriggeredInSourceState(MachineIndex, StateIndex, FName("ReloadComplete"));
} See Also
Tags
Version History
Introduced in: 4.11
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?