How to set default value to "self"?


How can I get my function on the left to have the same “Target [self]” pin as the one on the right?

looking for this, myself.

From what I can tell:

for C++ defined functions: use UFUNCTION metadata ‘DefaultToSelf = <paramname>’
and it looks like you can set only one parameter per function to use this feature.

Sadly, I don’t see any path to using this in a blueprint-only implementation that doesn’t require engine changes. That being said, I don’t think it would be difficult. Something like, in UEdGraphSchema_K2::TrySetDefaultValue - compare with the meta keyword before doing the package lookup.

Alternately, exposing various other of the meta functionality to functions in the advanced interface would be nice.

I am guessing here, but can’t you just put the right one into a variable and read it from there to the left one?

This fitted for my needs, may it helps you:

BlueprintPure, meta=(HidePin =
“WorldContextObject”, DefaultToSelf =
“WorldContextObject”)) static
AQuestManager* GetQuestManager(const
UObject* WorldContextObject);