Can I add animation notify using only C++?

Hello. Unreal Developer !
I can not speak English very well. hope you understand.

My question is,
Can I use C ++ only to add “Notify” to the montage and receive events from this “Notify”?

If this is possible,
Could you explain how to implement it?
This is what I found when I did a search, and I think it seems to be possible to implement it.

I want to implement,

I want to add “Notify” before playing montage and receive an event for “Notify” I added while montage is playing.

i need to add “notify” dynamically depending on the data in the CSV file( or ini file ).

To implement this,
Create a new class derived from UAnimNotify or UAnimNotifyState,
Should I also create a new class derived from UAnimInstance?

If you know about this, please feel free to reply. thank you.

I solved this problem.

void TEST::add_notify_in_montage(UAnimMontage* montage_in, FString notify_name_in, int32 frame_in)
	if (notify_name_in.IsEmpty())

	class UObject* AnimNotifyClass = NewObject<UObject>(montage_in, UCustomAnimNotify::StaticClass(), NAME_None, RF_Transactional);
	int32 my_index = montage_in->Notifies.Add(FAnimNotifyEvent());
	FAnimNotifyEvent& new_event = montage_in->Notifies[ my_index ];

	// Here you set the necessary information for the Custom Class.
	// I need "Notify" index and the name I defined.
	UCustomAnimNotify* notify = Cast<UCustomAnimNotify>(AnimNotifyClass);
	new_event.Notify = Cast<UAnimNotify>(notify);
	new_event.Link(montage_in, (float)frame_in / ANIMATION_FPS);
1 Like

You can also implement “NotifyState” in this way.
I created “UCustomNotify” using “UAnimNotify”.
You can implement “NofiyState” any number of times by using “UAnimNofifyState”.

1 Like