Can I declare a local variable in an event?

I understand how to use local variables in functions and coming from C++ I don’t see why I can not have them in events.
After all events are just junctions that are called when an event is triggered…

3 Likes

You said it yourself there. You can have local variables in blueprint functions.

Bottom left, it’s easy to miss.

My question was: If (as I know and use) you CAN have local variables in FUNCTIONS then, why NOT in EVENTS?

1 Like

Oh, I see. An event with local variables is basically a function without a return value then…

+1
I also want this feature desperately. For example it is very difficult to work with gameplay abilities, because ability tasks cannot be placed into functions and thus cannot rely on local variables. Using member variables is also not an option since it conflicts with the idea possibly using ability as non-instanced functors.

1 Like