UAnimInstance::QueryAndMarkTransitionEvent
#include "Animation/AnimInstance.h"
Access: public
Specifiers: ENGINE_APIUFUNCTIONBlueprintCallable
Description
Checks for pending transition events matching the specified transition and marks them as consumed so they will not trigger again. Returns true if matching events were found. This is the consuming counterpart to QueryTransitionEvent.
Caveats & Gotchas
- • Once an event is marked by this function it will not appear in subsequent queries within the same or future frames. If multiple transitions share the same event name, the first transition to call this function consumes the event for all of them.
- • Like QueryTransitionEvent, the machine and transition indices are compiled blueprint internals. Use this function from auto-generated transition rule bindings rather than passing hardcoded index values.
Signature
UFUNCTION(BlueprintCallable, Category="Animation", meta=(BlueprintThreadSafe, Keywords="Event,Query,Transition"))
ENGINE_API bool QueryAndMarkTransitionEvent(int32 MachineIndex, int32 TransitionIndex, TArray<int32>& OutSourceTransitionIndices); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| MachineIndex | int32 | Index of the state machine to query. | — |
| TransitionIndex | int32 | Index of the specific transition to check for pending events. | — |
| OutSourceTransitionIndices | TArray<int32>& | Output array populated with the indices of source transitions that had matching pending events. | — |
Return Type
bool Example
Consume a transition event in a transition rule C++
bool UMyAnimInstance::ShouldTransitionToJump(int32 MachineIndex, int32 TransitionIndex)
{
TArray<int32> SourceIndices;
// Consume the event so it only triggers one transition
return QueryAndMarkTransitionEvent(MachineIndex, TransitionIndex, SourceIndices);
} See Also
Tags
Version History
Introduced in: 5.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?