How to do it...

  1. Create a UInterface called PostBeginPlay:
  1. Open PostBeginPlay.h in Visual Studio and update the UINTERFACE of UPostBeginPlay and add the following virtual method in IPostBeginPlay:
#pragma once#include "CoreMinimal.h"#include "UObject/Interface.h"#include "PostBeginPlay.generated.h"UINTERFACE(meta = (CannotImplementInterfaceInBlueprint))class UPostBeginPlay : public UInterface{    GENERATED_BODY()};/** *  */class CHAPTER_08_API IPostBeginPlay{    GENERATED_BODY()    // Add interface functions to this class. This is the    // class that will be inherited to implement    // this interface.public: UFUNCTION(BlueprintCallable, Category = Test) ...

Get Unreal Engine 4.x Scripting with C++ Cookbook - Second Edition 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.