Fail to pass TArray from C++ to Blueprint

I want to pass a TArray from C++ to Blueprint. like this

Category = “chat”) void
dialogNames, TArray

But, When I use it in blueprint, it still told me something error with it. I use 4.4V

Can you show a code snippet which is using DisplayAddChatLineInfor()?


TArray dialogNames;
TArray dialogColors;

DisplayAddChatLineInfor(dialogNames, dialogColors);

Then there is errors like following my screen shot

I am not sure if the usage is correct. TArray is a Template class (as the T indicates). You have to tell this Array which type of Information it should contain.

For example:

TArray<class AActor> ActorArray;

would contain a variable amount of AActor classes.

For me it looks like you tried to to declare dialogNames and dialogColors as the Type/Class TArray, which makes no sense, because TArray is only a class Template.

What’s the declaration for DisplayAddChatLineInfor()?

Assuming you’ve passed the correct variable types, it’s requesting the function to accept const variables, which means the variables you’re passing are either declared as const variables or you’re instantiating the variables inline during the function call - which automatically declares the variables as const.

It’s AnswerHub joke, it’s eating some special characters.

I had a similar problem, I solved it by having the function signature as follows

MyFunction(const TArray<AActor*>& VarName)

It a really tricky way.^^ thank you very much