RealDocs

UAnimInstance::Montage_GetPlayRate

function Engine Blueprint Since 4.0
#include "Animation/AnimInstance.h"
Access: public Specifiers: ENGINE_APIconstBlueprintPureUFUNCTION

Description

Returns the play rate set on the montage instance. This does not account for the montage asset's RateScale, so the value may differ from the actual in-game playback speed.

Caveats & Gotchas

  • This function does NOT multiply by the montage's RateScale property. To get the actual speed the animation plays at in-game, use Montage_GetEffectivePlayRate instead.
  • Returns 0 if the montage is not currently playing. A return of 0 can mean either the montage is stopped or it was explicitly set to rate 0 — check Montage_IsActive to differentiate.

Signature

ENGINE_API float Montage_GetPlayRate(const UAnimMontage* Montage) const;

Parameters

Name Type Description Default
Montage const UAnimMontage* The montage to query. If NULL, returns the play rate of any active montage.

Return Type

float

Example

Log current montage play rate C++
float Rate = AnimInstance->Montage_GetPlayRate(ActionMontage);
UE_LOG(LogTemp, Log, TEXT("Montage instance play rate: %f"), Rate);

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.