Implement a BlueprintNative event in both C++ base class, C++ child classes and blueprint?

I have a function I want to implement in C++ base class:

BaseClass .h:

UFUNCTION(BlueprintCallable, BlueprintNativeEvent)
void MyFunction(); virtual void MyFunction_Implementation();

BaseClass .cpp:

void BaseClass::MyFunction_Implementation()
{
}

I want to override this in children base classes in C++:

ChildClass.h:

UFUNCTION(BlueprintCallable, BlueprintNativeEvent)
void MyFunction() override; virtual void MyFunction_Implementation() override;

ChildClass.cpp:

void ChildClass::MyFunction_Implementation()
{
}

but this doesn’t compile.
Is is possible to do this?
It works fine if the parent doesn’t add the implementation and the child does, but it seems the parent and child can’t each have their own

In the child class you don’t redeclare the MyFunction( ) version or the UFUNCTION. You just override the _Implementation version.

Thanks this works. I swear I had tried that, but I clearly missed something. For archival sake for future reference, this is what the example above should look like in the C++ Child class if you wanted to overwrite that function:

.h:

virtual void MyFunction_Implementation() override;

.cpp:

void ChildClass::MyFunction_Implementation()
{
}

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.