Local Variables in Macro

I can’t see anyone asking it yet so…Why we can’t use Local Variables in Macros? I think it’s necessary for some implementations in Macro Blueprints.
In a Class Blueprint we can use Functions but we can’t make a “Function Library” and in “Macro Library” we can’t use local variables… it’s like a dead end.

You can create ‘anonymous’ local variables inside a Macro. Have a look at something like the Do Once macro. You find them under Utilties->Macro.

2 Likes

That’s exactly what i need. Thanks :smiley:

I know this is old, But in case anyone else passes this up, You can also right click in a macro and type “Local <Integer, Float, Ect>” And it’ll pull up a Local Variable!
To set it, Type in “Assign” There is only one assign that’ll set up for you once you plug in a Local Variable and compile it, And there it is! Beautiful Local Variables! Hope this helps someone in the future!

8 Likes

**Entertainerx,**you deserve a medal :slight_smile:
Thanks so much for pointing this out !

For those who would like to assign local variables in macro blueprint libraries, you should consider those nodes :

7 Likes

It would be nice to name those variables somehow and reuse nodes to not have a spaghetti on screen.

2 Likes

There is a way to name it. Right click on node and write down in “node comment” :smiley:

1 Like