Any point using Pass by Reference if not editing?

I have an Actor variable as an input to a Function, if I’m not changing the variable is there any benefit to using Pass-By-Reference?

Trying to manage Memory.

when you send an actor to a function you are sending a pointer (address of that actor) and you can even change things of that actor. not just read values…if you have a variable ‘person’ that holds an actor of class John and you pass by ref that variable to a function, inside the function you can change stuff of john as instance but you can also set by ref the variable ‘person’ to become an actor of class Paul (a different actor and class).

anyway…objects in memory are just addresses that point to a place…you wont save or waste memory for that but if you don’t plan to change that variable just don’t send as reference.

2 Likes

Ok thanks.

1 Like