How to prevent the game from starting before the screen appears for the user?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By FelipeRattu

Every time i playtest or export something, while the godot splash screen is appearing for the player the game itself starts running in the background.

I’m making a runner game where the first thing the character do is jump up and perform a start animation and then starts running, this start animation never plays visually because it’s treggered when the game is loading so when the game pops up for the user the character is already in running animation :confused:

My workarround was to use a timer in the first line of the main _ready() method, but i don’t feel like that’s a solution because in slower machines maybe the time isn’t enough and in faster machines maybe if feels slow to start.

Is there a way to force Godot to first load the assets and stuff and then run the game’s _ready() methods and stuff? or maybe a method i can call on _ready() to wait for the game to show and run the rest of the code? idk :S

:bust_in_silhouette: Reply From: jgodfrey

Ideally, I think you’d want to load a scent that’s not the main game - typically that’d contain some sort of GUI that would allow the User to start the game when they’re ready.

That could be as simple as loading a GUI scene by default that contains a simple “Start” button. Pressing that button would then load the main “game” scene and start the game.

Thanks for answering ^^

actually i wanted to prevent some animations and other things to happen before the graphics load :S

i’m using a main menu for my game so when i hit play it loads the game scene and the same problem occurs, when the game loads my character has already performed the initial animations and are already running.

FelipeRattu | 2020-01-27 10:25