I’v inserted my native notifier to the animation but when i try to use it, it won’t fire.
This is the header:
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "Animation/AnimNotifies/AnimNotify.h"
#include "Enemy_Hit_Notifier.generated.h"
UCLASS()
class OLDSCHOOLNIGHTMARE_API UEnemy_Hit_Notifier : public UAnimNotify
{
GENERATED_UCLASS_BODY()
virtual bool Received_Notify(USkeletalMeshComponent* MeshComp, UAnimSequence* AnimSeq) const;
};
This is the source file:
// Fill out your copyright notice in the Description page of Project Settings.
#include "OldSchoolNightmare.h"
#include "Enemy_Hit_Notifier.h"
#include "Enemy_Character.h"
UEnemy_Hit_Notifier::UEnemy_Hit_Notifier(const FObjectInitializer& ObjectInitializer /*= FObjectInitializer::Get()*/)
: Super(ObjectInitializer)
{
}
bool UEnemy_Hit_Notifier::Received_Notify(USkeletalMeshComponent* MeshComp, UAnimSequence* AnimSeq) const
{
UE_LOG(LogTemp, Warning, TEXT("Animation Hit Notifying!"));
AEnemy_Character* character = Cast<AEnemy_Character>(MeshComp->GetOwner());
character->Hit_Notify();
return true;
}
It supposed to log “Animation Hit Notifying!”, but it is not logging anything, am i missing something ?
I also posted it on AnserHUB but got to answers over there…