Possible to use BlueprintAssignable dynamic multicast delegate in USTRUCT?

StefanHohnwald
Mon, 02 Dec 2019 18:14:32 +0000
Editor Scripting

Greetings.
I have a problem making blueprintassignable dynamic delegates of a USTRUCT visible in blueprint.
Simple example case:

DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FTestDel, bool, bTest);

USTRUCT(BlueprintType)
struct FTestStruct
{
GENERATED_BODY()
public:
UPROPERTY(BlueprintReadWrite)
bool bMember;

UPROPERTY(BlueprintAssignable)
FTestDel del;
};

This code compiles without any warnings or errors.
The bMember property is visible in Blueprint.
However, the del delegate is completely invisible and can not be assigned.

Are blueprintassignable dynamic delegates not supported for USTRUCTS in Blueprint? If so: would it be possible for future engine versions to make blueprintassignable dynamic multicast delegates in ustructs work with Blueprint? I’d hate to bloat UClasses that contain UStructs with additional delegates when it’s the UStructs that, code-logic wise, should have the delegates. On the other hand, i don’t want to replace the UStructs with UClasses for memory/performance/replication reasons.

If that is not possible,i think the compiler/UHT should throw an error message akin to “Error : UPROPERTY keyword Blueprintassignable not supported in member UPROPERTYs of USTRUCTs”

3 posts - 1 participant