Download

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.

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!

**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 :

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