Announcement

Collapse
No announcement yet.

Pass-by-Reference (Trouble Understanding)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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. https://answers.unrealengine.com/que...erence-do.html

    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.

    Thanks!
    -Neil (CaptainMigraine)
    Contact me: (Steam: Neillithan) (E-mail: neilvmoore@gmail.com)

    #2
    Originally posted by CaptainMigraine View Post
    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. https://answers.unrealengine.com/que...erence-do.html

    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.

    Thanks!
    -Neil (CaptainMigraine)
    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:

    Click image for larger version

Name:	Mesh.jpg
Views:	1
Size:	33.2 KB
ID:	1107447
    Pass-by-Reference

    Click image for larger version

Name:	mesh2.jpg
Views:	1
Size:	32.6 KB
ID:	1107448
    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.

    Comment

    Working...
    X