RealDocs

UAnimInstance::OnMontageBlendingOut

property Engine Blueprint Since 4.5
#include "Animation/AnimInstance.h"
Access: public Specifiers: UPROPERTYBlueprintAssignable

Description

Delegate broadcast when a montage begins blending out, whether the blend-out was triggered by natural completion, an explicit stop call, or an interruption by another montage.

Caveats & Gotchas

  • This fires at the start of the blend-out, not at the end. The montage is still influencing the pose while this delegate is active — use OnMontageEnded to react after the montage has fully finished.
  • The bInterrupted parameter is true when the montage was stopped before its natural end (e.g. via Montage_Stop or by another montage playing in the same group). Check this flag before assuming the full animation played through.

Signature

UPROPERTY(BlueprintAssignable)
FOnMontageBlendingOutStarted OnMontageBlendingOut;

Example

Bind to OnMontageBlendingOut to release a lock C++
void AMyCharacter::PlayAttackMontage()
{
    UAnimInstance* AnimInst = GetMesh()->GetAnimInstance();
    AnimInst->OnMontageBlendingOut.AddDynamic(this, &AMyCharacter::OnAttackBlendingOut);
    AnimInst->Montage_Play(AttackMontage);
}

void AMyCharacter::OnAttackBlendingOut(UAnimMontage* Montage, bool bInterrupted)
{
    if (Montage == AttackMontage)
    {
        bIsAttacking = false;
        GetMesh()->GetAnimInstance()->OnMontageBlendingOut.RemoveDynamic(this, &AMyCharacter::OnAttackBlendingOut);
    }
}

Version History

Introduced in: 4.5

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.