UAnimInstance::OnMontageStarted
#include "Animation/AnimInstance.h"
Access: public
Specifiers: UPROPERTYBlueprintAssignable
Description
Delegate broadcast immediately when a montage begins playing, at the start of its blend-in phase. Use this to react to the moment a montage is activated, for example to set state flags or start correlated effects.
Caveats & Gotchas
- • Fires at the very beginning of blend-in, so the montage has weight 0 on this frame. If you need to react after the animation has fully taken over the pose, use OnMontageBlendedIn instead.
- • This delegate is per AnimInstance, not per montage asset. If multiple montages can play, always check the Montage parameter to determine which one started before acting.
Signature
UPROPERTY(BlueprintAssignable)
FOnMontageStarted OnMontageStarted; Example
Set bIsAttacking flag when attack montage starts C++
AnimInstance->OnMontageStarted.AddDynamic(this, &AMyCharacter::OnMontageStarted);
void AMyCharacter::OnMontageStarted(UAnimMontage* Montage)
{
if (Montage == AttackMontage)
{
bIsAttacking = true;
}
} See Also
Tags
Version History
Introduced in: 4.5
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?