I want to bind a multicast delegate created in C++ in a blueprint.
The following code:
#pragma once
#include "GameFramework/HUD.h"
#include "TestHUD.generated.h"
DECLARE_MULTICAST_DELEGATE(FTestDelegate)
UCLASS()
class ATestHUD : public AHUD
{
GENERATED_UCLASS_BODY()
public:
UPROPERTY(BlueprintAssignable, Category = "Test")
FTestDelegate TestDelegate;
UFUNCTION(BlueprintCallable, Category = "Test")
void FireDelegate();
};
results in the following compile error:
Test4_5/Source/Test4_5/Public/HUD/TestHUD.h(16): error : In TestHUD: Unrecognized type 'FTestDelegate'
However if I remove the UPROPERTY
macro over the FTestDelegate TestDelegate;
the code compiles fine. Can it be some problem with that the macro isn’t evaluated before the build tool runs or something. Or what might be the problem?