While the previous recipes have focused on C++ being usable in Blueprint, such as being able to call functions from C++ in Blueprint, and override C++ functions with Blueprint, this recipe shows you the reverse: calling a Blueprint-defined interface function from C++.
Calling Blueprint-defined interface functions from C++
How to do it...
- Create a new UInterface called Talker (Creating the UTalker/ITalker classes):
- Add the following UFUNCTION implementation:
#pragma once
#include "CoreMinimal.h"
#include "UObject/Interface.h"
#include "Talker.generated.h"
// This class does not need to be modified.
UINTERFACE(MinimalAPI)
class UTalker : public UInterface
{
GENERATED_BODY()
};
/**
*
*/
class CHAPTER_08_API...