Beginner Question: What is pass by referance and when should I use it?

Hi Hi Samson F,

The pass by reference option in blueprints has the same concept of pass by reference in c++ or any other language. When you pass a var as reference and inside the function you modify the value, the var mantain the modify value. For example. create some integer var as local var of your blueprint Create a function with one input value as integer and Pass by reference, inside this Function increment the value of this var. Then in some place, initialice (with SET) the integer var with 1, for example, call your function passing this var as parammeter, then print the value of this var after the execution of the function. Test first with Pass by reference in true, and later with pass by reference in false. You will see the different.

Best regards.

In this example, you will see “2” on screen. If you change to false the Pass as reference, you will see “1”.