Main menu scene transition not working

Godot Version

Godot 4

Question

Hello, I just followed a tutorial to make a main menu and link the buttons to switch the scenes. When I tested it and clicked the play button, it just transitioned to a blank, gray scene. I just started using godot, did everything the video asked but I’m not sure what to do…

Does game.tscn actually have anything in it?

1 Like

Don’t hard code a scene. I would suggest makeing a new preloaded var for the scene and make shure you are actually getting what you need. Find the scene you want to put in the game in the file explorer on the bottom left corner. Then click and drag it on the script file below the extends Control. Before releasing the mouse button press ctrl on windows and release you should get somthing like

extends Control

const GAME := preload(“res://lessons/game.tscn”)

func on_play_pressed() → void:
get_tree().paused = false
get_tree().change_scene_to_packed(GAME)

1 Like

Hello, this question actually helped me figure it out! I think that was the issue, and I resaved the game scene so it had things in it. Thanks!

Thank you, I figured it out I think