Interface function "did not override any base class methods"

Every time I try to override an interface function in my Cabinet class, Unreal Engine returns an error: …Cabinet.h(25) : error C3668: ‘ACabinet::Interact_Implementation’: method with override specifier ‘override’ did not override any base class methods

I am very new to C++ interfaces, so any help is appreciated.

My Interaction Interface:

#pragma once

#include "InteractionInterface.generated.h"

UINTERFACE(MinimalAPI, Blueprintable)
class UInteractionInterface : public UInterface
{
    GENERATED_BODY()
};

class IInteractionInterface
{
    GENERATED_BODY()

public:
    UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
        void Interact(USceneComponent* HitComponent);
    UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
        void ExternalTrigger();
};

The relevant part of Cabinet.h:

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "InteractionInterface.h"
#include "Components/TimelineComponent.h"
#include "Cabinet.generated.h"

UCLASS()
class UNDERWATER_API ACabinet : public AActor, public IInteractionInterface
{
    GENERATED_BODY()

private:
    void Interact_Implementation(USceneComponent* HitComponent) override;
};

The interface function in Cabinet.cpp:
void ACabinet::Interact_Implementation(USceneComponent* HitComponent)

Are you trying to implement your function in C++? You use BlueprintImplementableEvent - and this means, that the Function cannot be implemented in C++.
Not sure, if this will cause exactly your error, but to implement in C++, try to use BlueprintNativeEvent and see, if this helps.

1 Like
  1. You don’t need UFUNCTION specifiers in the interface.

IInteractInterface.h:
virtual void Interact(USceneComponent* HitComponent) = 0;

  1. _Implementation mustn’t be in .h; with BlueprintImplementableEvent, you will implement it in the blueprint only.

ACabinet.h:

UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
void Interact(USceneComponent* HitComponent) override;
2 Likes