I’m creating a game where the player has to catch the falling objects before they hit the ground. I want to make it so that the player has a few seconds of preparation time before a round begins with a “Get Ready…” message in the middle. The expected result should be similar to the game “Pac-Man,” where the “READY!” message appears for several seconds before it disappears and the player is able to move.
![wait](https://forum.gdevelop.io/uploads/default/original/3X/8/4/843d75a644e97686ea5d46f33ccc77e982d9887b.png)
I thought I could do it simply by putting in the “Wait 3 seconds” action at the beginning of the scene, but the timer does absolutely nothing. What should I do in order to pause the scene for a few seconds before everything resumes again?
Bonus: I also want to make it so that the objects falling from the top spawns a second after the player is able to move.
The wait action is a bit misleading. It adds a wait for the events that it’s in the same event and any subevents directly under it. The rest of the events continue to run. If you moved the wait before the start (or reset) the timer it should do what you want. Just remember, only the timer function would be delayed. Other events could be delayed using a timer and/or Boolean variable.
Only the events in red are paused.
Your larger issue could be done with a timer instead of the wait. Start a timer with an at the beginning and show the “ready” message either as an object or on a layer and disable the player controls or set a Boolean depending on how you’re controlling the player. When the timer is over the initial time then hide the “ready” object or layer. (Use it with a trigger once) and enable the controls or set a Boolean. When the timer is greater than another amount of time then start the spawning timer and delete the first timer since it’s no longer needed.
As far as disabling controls are concerned, that would depend on how you’re moving the player. If you’re using the default controls then you could use the ignore default controls action. If not, you could add a Boolean and put the events under it as subevents. Set the Boolean DisableControls to true at the start. When the first amount of time passes then set the Boolean to false. Your control actions would be a subevent of DisableControls equals false
1 Like
Thanks for the help, Keith! Here’s what I did:
At the beginning of the scene, I created the “Get Ready…” message in the middle of the screen, then deleted the message after three seconds. Then, I ignored default controls for the player until the timer was over. However, I ran into another issue: if I pressed the left, right, or the space bar keys, the game will still play the running and jumping animation for the player. So I decided to remove the player’s sprite on the screen and have the player spawn on the screen as soon as the three seconds was over.
Ok. If it works. Go with it. If there’s no player then you probably don’t even need the disable control actions. Just add the player when you want.
1 Like