Changing "Return Value" display in BP

This is hopefully a simple question. How can I change the display value for the Return Value of a function in order to read as something other than ‘return value’ in the BP? I realize I can change the name of out params, but I haven’t been able to find how to change/set the name of the return value of a function.

I assume this is done in the UFUNCTION meta tag.

2 Likes

I would like to know this as well.

seaching for it too !

Did you get an answer for this in the end?

Answer with examples can be found here:
[How To define a function with multiple return values as blueprint in C++ - C++ - Epic Developer Community Forums][1]

Make sure you understand: [A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums][2]

Example:

Add the following directly before the parameter you would like to change:

UPARAM(DisplayName = "CustomNameA") 

.h file:

UFUNCTION(BlueprintCallable, Category = "MyBlueprintFunctionLibrary")
static void switchValue(const float a,const float b, UPARAM(DisplayName = "CustomNameA") float &a_out, UPARAM(DisplayName = "CustomNameB") float &b_out);

Make sure to return “void” otherwise you will get the default “Return Value” pin, which as fas as I know you cannot change the display name from, then set the return parameter to the value you would like to return from the function.

.cpp file:

void UMyBlueprintFunctionLibrary::switchValue(const float a, const float b, float &a_out, float &b_out)
{
a_out = b;
b_out = a;
}

The above will output the following:

135459-screenshot_1.png

5 Likes

Hello. Can you tell me how do I achieve basically the same thing but with Actor references instead of floats?

NVM. I just found my answer. You declare the parameter like this

void Foo(AActor*& ReturnedActor);

1 Like

306441-damage-multiplier-impl.png

306442-damage-multiplier-node.png

13 Likes

dont need to set void, the UPARAM before the function name will work:

UFUNCTION(BlueprintCallable, Category = “test”)
UPARAM(DisplayName = “newReturnName”) int func();

6 Likes

This helped me.

Its simple:
UFUNCTION(BlueprintCallable, meta = (ReturnDisplayName = "abc"))

8 Likes

This is way nicer than adding an ugly UPARAM in front of my function! Thank you.

2 Likes