Creating a UInterface
UInterfaces are a pair 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.
How to do it...
- UInterfaces don't show up inside the main class wizard within Unreal, so we'll need to add the class manually using Visual Studio.
- Right click on your Source folder inside Solution Explorer, and select Add | New Item.
- Select a
.h
file to start, and name itMyInterface.h.
- Make sure you change the directory for the item to be placed in from Intermediate to Source/ProjectName.
- Click on OK to create a new header file in your project folder.
- Repeat the steps in order to create
MyInterface.cpp
as your ...
Get Unreal Engine 4 Scripting with C++ Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.