Code outside the Main Loop (Scene)

One question, in a game you normally put the things that you don’t want to be Refreshed in each frame, outside of the Main Loop In Gdevelop how can you do this? For example I want to make another Loop that every 1 minute refreshes the global score and other things and not in every frame, it would break the server (I have knowledge of javascript)

Thanks in advance

Well, in GDevelop you can use timers to trigger something based on real time. If you really want to do it the JavaScript way, you could use setInterval/setTimeout, but I would recommend to not do that as that would mean enclosing runtimeScene in the callback, therefore preventing the scene from being freed after it has been destroyed causing a memory leak in your game.

1 Like