AnimNotify Not Triggered If Using PlayAnimation Function

AnimNotify events are not triggered if an animation montage is played using the PlayAnimation function.
Is this a bug or is there a workaround?

Hi calembendell,

I am not experiencing any issue receiving AnimNotify events when using the PlayAnimation( ) function or by using the Montage_Play( ) function.

I created a AnimNotify class as follows:

[.h]

#pragma once

#include "Animation/AnimNotifies/AnimNotify.h"
#include "FPCustomAnimNotify.generated.h"

UCLASS()
class FPCODE_API UFPCustomAnimNotify : public UAnimNotify
{
	GENERATED_BODY()
	
public:

	virtual void Notify(USkeletalMeshComponent* MeshComp, UAnimSequenceBase* Animation) override;	
};

[.cpp]

#include "FPCode.h"
#include "FPCustomAnimNotify.h"

void UFPCustomAnimNotify::Notify(USkeletalMeshComponent* MeshComp, UAnimSequenceBase* Animation)
{
	UE_LOG( LogTemp, Warning, TEXT("ANIMATION FROM MESH: %s "), *MeshComp->GetName( ) );
}

I can now use this as a AnimNotify within either the Animation Asset or Animation Montage, both will send the log message from the Notify function, inside the UFPCustomAnimNotify class.

Furthermore, I am also able to create notifies using the “New Notify” option and give it a name, in the Animation Asset viewer, which will allow me to get that event in the Animation Blueprint Event Graph.

If you are still having an issue, please post some more information on the code you are writing and what you are trying to do.

hey, thanks for the help!
this works great.
my notifications still aren’t working in blueprints, but that’s fine since i’d rather do it in c++ anyway.
is there a wiki article or something that has more information on this method?
i’m having trouble finding resources for handling animations in c++.

This is the current documentation on AnimNotifies:

https://docs.unrealengine.com/latest/INT/Engine/Animation/Sequences/Notifies/

This is aimed at using them within the Animation Blueprint Event Graph and not C++.