Sometimes, you may need to create a UInterface that specializes on a more general UInterface. This recipe shows you how to use inheritance with UInterfaces to specialize a Killable interface with an Undead interface that cannot be killed by normal means.
Inheriting UInterfaces from one another
How to do it...
- Create a UInterface/IInterface called Killable:
![](https://static.packt-cdn.com/products/9781789809503/graphics/assets/20054dc1-f6a5-4b7e-aec6-a85686630416.png)
- Add UINTERFACE(meta=(CannotImplementInterfaceInBlueprint)) to the UInterface declaration:
// This class does not need to be modified.
UINTERFACE(meta = (CannotImplementInterfaceInBlueprint))
class UKillable : public UInterface
{
GENERATED_BODY()
};
- Add the following functions to the header file under the IKillable class:
class CHAPTER_07_API IKillable
{
GENERATED_BODY...