One of the key advantages of UInterface in Unreal is the ability for users to implement UInterface functions in the editor. This means that the interface can be implemented strictly in Blueprint without needing any C++ code, which is helpful to designers.
Implementing UInterface functions in Blueprint
How to do it...
- Create a new UInterface called AttackAvoider:
- Add the following function declaration to the header:
#pragma once
#include "CoreMinimal.h"
#include "UObject/Interface.h"
#include "AttackAvoider.generated.h"
// This class does not need to be modified.
UINTERFACE(MinimalAPI)
class UAttackAvoider : public UInterface
{
GENERATED_BODY()
};
class CHAPTER_08_API IAttackAvoider
{
GENERATED_BODY...