How to collapse function variables in Blueprint?

Hello. To put it quite simply, I was wondering how to group/hide variables of a function, similar to the Print String function. I have been digging around, but I cannot find out how to do this.

I’m sorry if the title is misleading, I don’t know how else to phrase it.

This is what I mean. I want my own functions to be able to do this.

190684-ps_collapsed.jpg

Clicking the arrow:

190686-ps_open.jpg

I tried putting in default values for my function’s parameters, but that didn’t work. Any help would be appreciated.

Thanks for reading.

By your question I do not understand if you have problems sending values ​​to the function or to collect values.

In doubt, I made an example using the 2 cases.

Create a function. Add one input parameter (Champion) and one output parameter (Champion Selected):

In the character blueprint, create two variables of type string (varText1 and varText2). When you click A, the variable (varText1) is set to a value that is entered into the function:

Within the function (see figure 1), the variable will be printed and with an append it will eventually be stored in the output parameter (Champion Selected) of the function.

The function ends by defining the value of the second variable.

Again in the character code, pressing C, variable 2 (varText2) will be called. If A or B have already been pressed, the text Champion + was selected will be written:

This can be done through C++:
you should add one of these two meta tags to your UFUNCTION
AdvancedDisplay=N
or
AdvancedDisplay="Parameter1, Parameter2, .."
for example your function will look like this :

UFUNCTION(BlueprintCallable,meta=(AdvancedDisplay=2))
void MyFuntion (int a,int b,int c ,int d);

so in blueprint only a and b are visible by default but c and d will be collapsed and only visible when user expands the function.
image
image

more info: Metadata Specifiers in Unreal Engine | Unreal Engine 5.3 Documentation