DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam with TArray

How can I use DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam with TArray parameter? I can use it with the other common types, but I cannot use with TArray.

// e.g.
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam( FGenerateMyDataDelegate, TArray< uint8 >, MyData );

I can compile(build) the source. But it will occur an error in compiling a blueprint. The error is below:

LogBlueprint: Error: [Compiler VW0_BP] Generate My Data  Signature Error: The function/event 'OnSuccess_C9A93DFE4DF51C0C6C9496873C6AAC62' does not match the necessary signature - has the delegate or function/event changed?
LogBlueprint: Error: [Compiler VW0_BP] Generate My Data  Signature Error: The function/event 'OnFail_C9A93DFE4DF51C0C6C9496873C6AAC62' does not match the necessary signature - has the delegate or function/event changed?

I can compile a blueprint if use a USTRUCT wrapper instead a TArray. And I can compile if the other type something like UTexture too.

Is it a bug or the specification? If you know how to use a Tarray directly then tell me please it.

4 Likes

Try passing the array as a const reference

DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FGenerateMyDataDelegate, const TArray<uint8>&, MyData);
14 Likes

It’s a cool answer! Thank you.

Thank you for the answer, man!
Saves me tons of time! :smiley:

Wow, tried it for a custom GetAllActorsOfClass Async task, returning TArray and it freaking works. THX!