Hi, I’m trying to get a basic BlueprintImplementableEvent to work. I want my BP AIController to to inherit from a C++ AIController (shown below). I want my C++ AIController to define a BlueprintImplementableEvent, very basic, and I already did this in a tutorial in 4.6, but now it doesn’t compile any more.
Below - the code and compile errors:
#pragma once
#include "AIController.h"
#include "MTAIController.generated.h"
/**
*
*/
UCLASS()
class MENGTIAN_API AMTAIController : public AAIController
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintImplementableEvent, Category="MengTian")
void Communicate(FString msg);
};
When I compile the above, I get the errors:
C:\GameDev\MengTian\Intermediate\Build\Win64\UE4Editor\Inc\MengTian\MengTian.generated.cpp(34): error C2511: 'void AMTAIController::Communicate(const FString &)' : overloaded member function not found in 'AMTAIController'
2> C:\GameDev\MengTian\Source\MengTian\Public/MTAIController.h(12) : see declaration of 'AMTAIController'
2>C:\GameDev\MengTian\Intermediate\Build\Win64\UE4Editor\Inc\MengTian\MengTian.generated.cpp(37): error C2352: 'UObject::FindFunctionChecked' : illegal call of non-static member function
2> c:\program files\epic games\4.9\engine\source\runtime\coreuobject\public\uobject\UObject.h(752) : see declaration of 'UObject::FindFunctionChecked'
2> -------- End Detailed Actions Stats -----------------------------------------------------------
2>ERROR : UBT error : Failed to produce item: C:\GameDev\MengTian\Binaries\Win64\UE4Editor-MengTian.pdb