RealDocs

UAnimInstance::StopAllMontages

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

Description

Stops every currently active montage on this AnimInstance simultaneously, blending each one out over the specified duration. Use this for hard resets — entering a ragdoll, a hit-reaction override, or cinematic entry.

Caveats & Gotchas

  • Calls each montage's OnMontageInstanceStopped delegate, so any callbacks registered with Montage_SetEndDelegate or Montage_SetBlendingOutDelegate will still fire for each stopped montage. Be careful not to trigger re-entrant play calls inside those callbacks.
  • Passing 0.0f for InBlendOutTime pops all montages off instantly with no blend, which can cause visible animation snapping if the skeleton is in a strongly-posed state.

Signature

ENGINE_API void StopAllMontages(float InBlendOutTime);

Parameters

Name Type Description Default
InBlendOutTime float The blend-out duration in seconds applied to every active montage instance.

Return Type

void

Example

Clear all montages when the character dies C++
void AMyCharacter::OnDeath()
{
    if (UAnimInstance* AnimInstance = GetMesh()->GetAnimInstance())
    {
        // Blend out over 0.25 seconds to avoid a pop
        AnimInstance->StopAllMontages(0.25f);
    }
    // Then activate ragdoll physics
    GetMesh()->SetSimulatePhysics(true);
}

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.