Ensure that you've followed the previous recipe in order to have a UInterface
ready to be implemented.
Create a new
Actor
class using the Unreal Wizard, calledSingleInterfaceActor
.Add
IInterface
—in this case,IMyInterface
—to the public inheritance list for our newActor
class:class UE4COOKBOOK_API ASingleInterfaceActor : public AActor, public IMyInterface
Add an
override
declaration to the class for theIInterface
function(s) that we wish to override:FStringGetTestName() override;
Implement the overridden function in the implementation file by adding the following code:
FStringASingleInterfaceActor::GetTestName() { return IMyInterface::GetTestName(); }