Skip to content

Instantly share code, notes, and snippets.

@mlewand
Last active January 23, 2016 14:22
Show Gist options
  • Save mlewand/acd5e243f8d169f6e94c to your computer and use it in GitHub Desktop.
Save mlewand/acd5e243f8d169f6e94c to your computer and use it in GitHub Desktop.
An example of UAnimNotify inheriting class.
// Fill out your copyright notice in the Description page of Project Settings.
#include "sample1.h"
#include "Enemy_Hit_Notifier.h"
UEnemy_Hit_Notifier::UEnemy_Hit_Notifier( const FObjectInitializer& ObjectInitializer /*= FObjectInitializer::Get()*/ )
: Super( ObjectInitializer )
{
}
void UEnemy_Hit_Notifier::Notify( USkeletalMeshComponent* MeshComp, UAnimSequenceBase* Animation )
{
Super::Notify( MeshComp, Animation );
UE_LOG( LogTemp, Warning, TEXT( "Animation Hit Notifying!" ) );
}
// Original file created by Sahkan (https://answers.unrealengine.com/questions/231681/my-uanimnotify-custom-c-class-received-notify-wont.html)
// 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 UEnemy_Hit_Notifier : public UAnimNotify
{
GENERATED_UCLASS_BODY()
virtual void Notify( USkeletalMeshComponent* MeshComp, UAnimSequenceBase* Animation ) override;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment