How to make a function with a input pin result to output pin

I have a blueprint callable function written in c++ and I have a pointer input parameter witch would be overwritten in the function. And I wanna make it as a result pin for context help.
If I declare the parameter as a referenced one. then It will not showing the pin at the input part.
How can I make the function have both input and output parameter pin?

UFUNCTION(BlueprintCallable)
void Foo(ASomeThing*& thisWillBeOnlyOutputParam);
1 Like

Based on my own experience and research, if you’re looking to have a function parameter serve as both an input and an output pin in Unreal Blueprints, the only straightforward solution seems to be declaring separate parameters for input and output. Then, you can manually link the two inside the function

UFUNCTION(BlueprintCallable)
void Foo(UPARAM(Ref) ASomeThing*& thisWillBeOnlyOutputParam);

This should show as input with the diamond pin to show that it’s passed by reference.
It will not show an output pin though, if you want one you need an additional parameter.