Local variables in blueprint functions

Does anyone understand how the local variables in Blueprint functions work?

I can create a local variable and it creates an item that will let me retrieve and use the value but I cannot seem to set the value of the variable. Am I missing something obvious?

Thanks

It looks like after you have your function variable in your blueprint, you can drag a line from it, and type “set” in the search field. You should see an option for “Set ‘Your variable.’” You can then link it to a set variable node. You can edit this node in the details panel and connect it in the chain in your function.

Hope that helps.

As far as i know, the above does not work for local variables. And i can’t find anything on it currently.

Okay, try this:

Drag a line from the local variable and release the mouse button. There should be an option “Assign” under “Variables.”

Let me know if that helps!

1 Like

Hello. Try it https://www.youtube.com/watch?v=2iNcGQMJp9s&index=61&list=PLZlv_N0_O1gaCL2XjKluO7N2Pmmw9pvhE

Obsidiaguy - thanks … That worked.

I’ll use this thread, cause my issue is related to the same topic…

How “local” is a local function variable in UE4.4?

1: myBP -> myFunc1 -> add Local Variable: myLocalVar: type int

2: use myLocalVar within myFunc1.

3: myBP -> myFunc2 -> add Local Variable: myLocalVar: type float

4: trying to delete the last created local variable will display a warning: “Local Variable myLocalVar is in use! Do you really want to delete it?”

Drag a node off of whatever thing you want your variable to plug into, then click “promote to local variable”. This gets you a call for the variable you can copy and paste wherever you need it.
Hope this helped.

1 Like

well this is a decade old

1 Like