UAnimInstance::Montage_GetBlendTime
#include "Animation/AnimInstance.h"
Access: public
Specifiers: ENGINE_APIconstBlueprintPureUFUNCTION
Description
Returns the current blend-in or blend-out time remaining for the montage in seconds. Reflects how far through the blend envelope the montage currently is.
Caveats & Gotchas
- • The returned value is the blend weight transition time, not the animation playback position. A montage can have a non-zero blend time even when its playback has finished — it may still be fading out.
- • If the montage is fully blended in and not yet blending out, this may return 0 even while the montage is actively playing.
Signature
ENGINE_API float Montage_GetBlendTime(const UAnimMontage* Montage) const; Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| Montage | const UAnimMontage* | The montage to query. If NULL, returns the blend time of the first active montage found. | — |
Return Type
float Example
Wait until montage is fully blended in before enabling IK C++
void UMyAnimInstance::NativeUpdateAnimation(float DeltaSeconds)
{
// Only enable hand IK once the montage has fully blended in
float BlendTime = Montage_GetBlendTime(AimMontage);
bEnableHandIK = Montage_IsActive(AimMontage) && FMath::IsNearlyZero(BlendTime);
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?