[JS Events] How to access global variables?

Tried runtimeGame.getVariables but supposedly it doesn’t exist. Or maybe RuntimeGame is singleton class?

Almost, it’s:


(See 4ian.github.io/GD-Documentation/ … Scene.html)

Thanks! Though game objects should be accessible as runtimeGame - it’ll be more intuitive that way.

No, because when you manipulate the runtimeScene, you manipulate object’s instances, not the objects themselves.

There’s one game anyway, so what would it hurt to make it a singleton? In the context of GD game more than one RuntimeGame object doesn’t even make sense!

I think that there was a confusion when your wrote game objects should be accessible as runtimeGame, victor understood game objects as “the objects in the object editor” whereas you was refering to “the GDevelop API objects”.