Button-Based Scene Transition

Hello,
I’m very new to game development. I want to create a virtual pet system. On the initial scene, there is a “Start” button, which I have activated and made clickable. This allows me to transition to the game scene. My problem is that I want the screen to slowly fade to black for about 2 seconds when the Start button is pressed, and then transition to the game scene. I’m not very familiar with the events section, and nothing I’ve tried has worked. Could you help me with this?

I do a fade-to-black between scenes (and fade back from black when the new scene loads). I use a black rectangle that covers the scene, and I use an opacity tween. Here’s an example:


I have a small black rectangle in the top left of every scene in my game. My first action moves it to where I want, and the second action resizes it so that it covers the whole scene. You could just use a big enough object to do it, but I like to keep the size of my graphics down. The rectangle has the tween behaviour, which lets you animate it with an action like ‘tween opacity’. Ignore the next two actions. Then I use a ‘wait’. Otherwise the scene would change before the player sees the fade-to-black animation. Finally, the scene change action. In my case the fade to black takes half a second, and then there’s an addition 0.2 seconds before the scene change, which is long enough for me sound effect to play. You could simple have your tween take 2 seconds and your wait action would also need 2 seconds.

Tweens need a trigger once in the conditions so that they play properly and don’t restart every frame. If a lot of this doesn’t make sense you to, at least you should have a few things to look up and experiment with from my post.

There is also a transition extension that has various effects. It’s called ‘flash and transition painter’.

Edit: I often disable things in this event to stop the player opening their inventory or doing other things during a transition. So think about all the things you don’t want the player do be able to do during that 2 seconds and work out how you’ll prevent them. I often use variable to do this.