Create global variables within the event editor

Good evening, I’ve been using gdevelop 5 for two years and I’m really happy with it…but I’m writing to ask the developers: is it possible to create global variables directly within the event editor? This option would be very convenient.
Good evening :blush:

Long answer: The developers explicitly updated the variable workflow to match Javascript, in that all variables must be predeclared. This is to avoid potential naming conflicts and other issues that arise from declaring variables mid-logic. They have stated repeatedly since that change that they would not be switching back.

Short answer: No.

You can add a keyboard shortcut to pull up the global variables window from anywhere if you go into your engine preferences, click the Keyboard Shortcuts tab, and scroll to the Project section.

Thank you so much for your reply…you were very kind

1 Like

As you see i created scene (could be global) variable called Z and set it to be structure

Now this variable have no child vars
BUT i can create them dynamically in events sheet without declaring them
Only downside i need to add Z[“”] to each variable
But as you see it does not give me any error

And so i can create what ever i want wherever i want without declaring anything more beyond that one structure variable

thank you so much it was so simple I didn’t understand