Pass-by-Reference (Trouble Understanding)

I wanted to know what “pass-by-reference” means concerning “blueprint functions”. I stumbled upon this thread with a user who attempts to explain it. What does Pass-By-Reference do? - Editor Scripting - Epic Developer Community Forums

Unfortunately, I’m mostly a visual / trial by error kind of learner and I don’t understand this particular explanation.

Is there a way that “pass-by-reference” can be demonstrated, either via pictures or video so that I can come to a better understanding?

It would be greatly appreciated if someone from either the community or UE devs could help me with this. :slight_smile:

Thanks!

A reference works like a pointer. Inside Blueprint, there’s no difference between these two, imo.

So, when you bring a reference inside a function, you are basically bringing the original variable inside the function. That means you can change the value of this variable without explicitly calling it again inside the function.

Like the little example I’ve made below:

Mesh.jpg
Pass-by-Reference

mesh2.jpg
Pass-by-value

You can see a lot of difference between these two functions, the first can set ANY Mesh you pass by parameter to the desired Mesh (In my ex, null). The second, you only update the variable that is inside the function, so you couldn’t make it generic, it would be very specific for this case.