UAnimInstance::GetInstanceTransitionTimeElapsedFraction
#include "Animation/AnimInstance.h"
Access: public
Specifiers: UFUNCTION
Description
Returns the normalized progress (0.0–1.0) of a state machine transition's crossfade, where 0.0 means the transition just started and 1.0 means it is complete. Equivalent to dividing GetInstanceTransitionTimeElapsed by GetInstanceTransitionCrossfadeDuration.
Caveats & Gotchas
- • Returns 0.0 when the transition is inactive, the same value it returns at the very start of a transition. You cannot distinguish between 'not active' and 'just started' from this value alone.
- • If the crossfade duration is zero (instant transition), the fraction jumps directly from 0.0 to 1.0 in a single frame, making it unsuitable for driving smooth visual effects on instant transitions.
Signature
UFUNCTION(BlueprintPure, Category="Animation", meta=(BlueprintInternalUseOnly = "true"))
float GetInstanceTransitionTimeElapsedFraction(int32 MachineIndex, int32 TransitionIndex) const; Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| MachineIndex | int32 | Index of the state machine containing the transition. | — |
| TransitionIndex | int32 | Index of the transition within the state machine. | — |
Return Type
float Example
Use transition fraction to blend a sound effect C++
float Fraction = GetInstanceTransitionTimeElapsedFraction(MachineIdx, TransitionIdx);
// Smoothly fade in a sound during the transition
MyAudioComponent->SetVolumeMultiplier(Fraction); See Also
Tags
Version History
Introduced in: 4.8
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?