UInterfaces are pairs of classes that work together to enable classes to exhibit polymorphic behavior among multiple class hierarchies. This recipe shows you the basic steps involved in creating a UInterface purely in code.
Creating a UInterface
How to do it...
- From the Content Browser, go to Add New | New C++ Class. From the menu that pops up, scroll down all the way until you see the Unreal Interface selection and select it. Afterward, click on the Next button:
![](https://static.packt-cdn.com/products/9781789809503/graphics/assets/6dca5f4f-671b-4279-91c2-4ec127cda935.png)
- From there, verify that the Name of the class is MyInterface and then click on the Create Class button:
![](https://static.packt-cdn.com/products/9781789809503/graphics/assets/c611d729-5476-4d87-8324-0052c4d67e5c.png)
- Add the following code to the header file:
#pragma once
#include "CoreMinimal.h"
#include "UObject/Interface.h"
#include "MyInterface...