1
\$\begingroup\$

MyFunction( Class *& foo )

Inside a derivative BP of the above C++ class:

foo shows up as an output rather than an input.

Why?

\$\endgroup\$
2
\$\begingroup\$

Non-const references in C++ functions exposed to Blueprint are always treated as outputs by the parser in UnrealHeaderTool.

You can see this in the (very involved) logic of FHeaderParser::GetVarType in Engine/Source/Programs/UnrealHeaderTool/Private/HeaderParser.cpp. This is called by ParseParameterList during parsing a functions parameter list.

If you want foo to be an input, add const (this is what functions like RandomFloatFromRangeInStream do to facilitate passing the heavyweight stream parameter as an input).

You cannot make it simultaneously an input and an output parameter.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.