How to get animation Notifies in C++?

I’ve always used this to get the current array of notifies


//BeginPlay
Animation = Cast<UAnimInstance>(Mesh->GetAnimInstance());

//Tick
Animation->NotifyQueue.AnimNotifies.Num()

But ever since 4.12 it doesn’t work anymore.
I haven’t seen anyone else mention this and they didn’t fix it in any of the hotfixes, which is weird because notifies are such a big part of animation.

So I’m thinking, am I just doing it wrong?

How do you get animation notifies in C++?

Thanks!

I just normally create functions in the C++ class, like “OnNotifyX” and then, in the animation blueprint i do the event normally, and call that function.

Ah I see, that makes sense.

Hoping they fix the c++ side soon, as Anim notifies are such core components to games.

You can just check the member in UAnimInstance:: ```

TArray < const struct FAnimNotifyEvent * > AnimNotifies

It will have all the Notify`s triggerd last frame/tick.

Hope it helps
WCode

That was depreciated in 4.11. So:


Animation->AnimNotifies

(Depreciated, doesn’t do anything)

and


Animation->NotifyQueue.AnimNotifies

the new preffered way, is broken.

Edit: Still broken in 4.12.3

Good to know cheers.

also in 4.12.5.



for (int32 Index=0; Index<NotifyQueue.AnimNotifies.Num(); Index++)

from


void UAnimInstance::TriggerAnimNotifies(float DeltaSeconds)

has zero elements.

Epic, if you don’t mind, can you please chime in? Any update about this issue would be greatly appreciated!

Thanks!

This seems to be broken in 4.16 as well. Epic, could you please comment on this?

EDIT: To clarify what is broken, I’m trying to loop through the UAnimSequenceBase::Notifies array (I’m just getting it through UAnimMontage).
But the Notifies array is always empty, so I’m guessing it’s broken. If not, please enlighten me on how to do this. :slight_smile:

EDIT 2: It works when I add the notifies onto the montage itself, so I guess I’ll have to do that for now.

great thread. I love it.