[Suggestion] Make Brueprint function inputs - local variables

How exactly are they implemented? What If I have a pointer to a struct as parameter? Will the local variable still be a pointer to it and no local copy?

Under the hood it behaves exactly as if you had wired from the function input output pin, or function return input pin, so it should do what you want/expect for reference variables. However, it is worth noting that even reference variables are actually passed by value in the Blueprint VM, but then copied back on return.

Cheers,

Nice to hear this will come in 4.16.

Oh, didn’t know that. Why isn’t there a real call by reference for blueprints?

Legacy. The same was true of UnrealScript as well and the bytecode VM for UnrealScript formed the foundation of Blueprints. Most of the time it’s not a big issue, especially for ints/floats/etc…, but it can really matter for large arrays of complex structs that cannot be memcopied but have to be copied element by element.

Cheers,

Praise the Joatski.

A bit of derailing, but since this topic has more attention of right people, and my idea is not very far from this topic:

Inside functions, in blueprints. Could we get all function parameters and return values as default local variables?

So for eg if my function has integer as parameter called INT and result called IsEven. Could we get default local variables for those two that are “magically” connected to input and result pins.

ps. nevermind i read it is comming in 4.16

And it’s indeed in 4.16! :slight_smile:

Indeed, but isn’t it a bit laborious that we need to search for the variables with the Context Menu?

I would recommend having them in the same column as the other variables:

(and get rid of the Inputs Tab in Functions)

I also agree with Raildex_. Since we can already call up on the function input variables from the context menu, I’m sure it’s not gonna be that difficult to add them in the column where the other variables are.