{ }Blueprint → C++

Unreal Engine 5 · Blueprint → C++

Declare a Blueprint Interface in Unreal Engine 5 C++UE Docs

A Blueprint Interface in C++ is declared as two classes: a UINTERFACE-marked UMyInterface reflection stub and a plain IMyInterface that holds the functions, marked Blueprintable so Blueprints can implement it.

Blueprint node & C++ equivalent

C++
// MyInterface.h
UINTERFACE(MinimalAPI, Blueprintable)
class UMyInterface : public UInterface { GENERATED_BODY() };

class IMyInterface
{
  GENERATED_BODY()
public:
  UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category="Interface")
  void Interact();
};

What does declaring a Blueprint Interface do?

Declaring an interface defines a contract: a set of functions that any class can promise to implement, regardless of its base class. The Blueprint editor's Create Blueprint Interface asset is the visual equivalent of writing the UINTERFACE pair in a header file.

The Blueprintable specifier on UINTERFACE(MinimalAPI, Blueprintable) is what makes the interface visible to and implementable by Blueprint assets, not just C++ classes. MinimalAPI keeps the module's exported symbol surface small.

The C++ equivalent

Every UE5 interface is two classes. UMyInterface derives from UInterface, carries the GENERATED_BODY() macro, and exists purely so the reflection system can identify the interface. The real work lives in IMyInterface, which also uses GENERATED_BODY() and declares the actual functions.

Marking Interact() with UFUNCTION(BlueprintNativeEvent, BlueprintCallable) gives it a native C++ default that subclasses override in Interact_Implementation, while still allowing Blueprints to override it. Category="Interface" controls where it appears in the Blueprint node palette.

Common mistakes

Do not put function bodies on the U-class, and do not forget the matching I-class. Both classes must share the same base name with U and I prefixes, or the engine will fail to wire them together. Also do not mark a BlueprintNativeEvent function as pure virtual (= 0) or give it an inline body, since UnrealHeaderTool generates the Interact thunk and you only define Interact_Implementation.

Frequently asked questions

What is the difference between UMyInterface and IMyInterface in UE5?+

UMyInterface is the UObject-based reflection stub the engine uses to register the interface, while IMyInterface holds the actual function declarations your classes implement. You almost always work with the I version in code.

Why use BlueprintNativeEvent on an interface function?+

BlueprintNativeEvent lets you provide a C++ default in Interact_Implementation while still allowing Blueprint classes to override the function. Use BlueprintImplementableEvent instead if there is no C++ default.

What does MinimalAPI mean in UINTERFACE?+

MinimalAPI exports only the class's type information rather than every member, reducing module link size. It is fine for interfaces that are used within the same module.

Related Interfaces nodes

View all Interfaces nodes →