UAnimNotifyState, how to tell if its NotifyEnd was called by interrupt?

I derive a class that extends UAnimNotify and override its NotifyBegin and NotifyEnd functions to be able to tell when some specific things happen in my montages.

NotifyEnd is being called by interrupts, when, for example i call AnimInstance->StopAllMontages(); which is great, that’s what I want. However, I cannot seem to find a way to tell apart if the NotifyEnd was called by an interrupt, or if it was called because the montage hit the end of the notify naturally.

Now, i know i can bind to AnimInstance()->OnMontageEnded which provides bInterrupted in the callback, but I’d really like to be able to tell this in the notify, as that looks like the cleanest way.

Any ideas how to implement something like this?

Turns out, it is quite simple if you override the new(er) UAnimNotifyState::NotifyEnd.
The one that provides a const FAnimNotifyEventReference& EventReference (virtual void NotifyBegin(USkeletalMeshComponent* MeshComp, UAnimSequenceBase* Animation, float TotalDuration, const FAnimNotifyEventReference& EventReference) override;)

You can then use the EventReference in your overridden NotifyEnd like so bool notifyInterrupted = !UAnimNotifyLibrary::NotifyStateReachedEnd(EventReference); This seems to work.

1 Like

Hope this helps anyone who is looking for an answer in the big 2025

After looking everywhere I finally found a solution. UE 5.6 added the new
UAnimNotifyState_EarlyOutContextualAnimWindow
Just drag out the EventReference and use GetCurrentAnimationNotifyStateTimeRatio to check if the value is less than 1. Anything less than 1 is an early out of the notify.