Hello,
To explain my issue I’ll use Basic Code template named “MyProject” in UE 4.12 with basic Interface and AActor object.
C++ code:
MyInterface.h
UINTERFACE(Blueprintable)
class MYPROJECT_API UMyInterface : public UInterface
{
GENERATED_UINTERFACE_BODY()
};
class IMyInterface
{
GENERATED_IINTERFACE_BODY()
public:
UFUNCTION(BlueprintCallable, BlueprintNativeEvent, Category = "A")
void MyEvent(bool& ReturnValue);
};
MyActor.h
UCLASS()
class MYPROJECT_API AMyActor : public AActor, public IMyInterface
{
GENERATED_BODY()
public:
// Sets default values for this actor's properties
AMyActor();
// Called when the game starts or when spawned
virtual void BeginPlay() override;
// Called every frame
virtual void Tick( float DeltaSeconds ) override;
virtual void MyEvent_Implementation(bool& ReturnValue) override;
};
In content browser I Create Blueprint Class based on MyActor, let’s call it MyActorCPP.
Now in MyActorCPP blueprint there’s an implementable MyEvent function, but after implementing it there’s a compile error:
"Cannot override 'MyInterface::MyEvent' at My Event which was declared in a parent with a different signature".
It only happens when function declaration contains a reference. (MyActorCPP.jpg)
What’s strange is that when i create new Blueprint class based on AActor and add MyInterface through Class Settings, MyEvent can be compiled without errors. (MyActorBP.jpg)
Does that mean I cannot implement C++ interface functions in Blueprints this way, or is it a bug?