Bind multicast delegate from C++ in blueprint

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?

I think You need change

DECLARE_MULTICAST_DELEGATE

to

DECLARE_DYNAMIC_MULTICAST_DELEGATE

That solved the problem. Very misleading documentation though.

/// MC Delegates only.  Property should be exposed for assigning in blueprints.
BlueprintAssignable,

Didn’t realize that “MC Delegates” actually did stand for “Dynamic Multicast Delegates” and not “Multicast Delegates”.

However thanks a lot!

If you want to access it in C++ then you need it to be Dynamic, if you only want to access in Blueprints then you don’t need to to be Dynamic.