Changing scene does not work on button press

Godot Version

4.2

Question

I am new to godot and I am trying to create a pause menu for my 2D game, everything works correctly, but there is an error when I press the “exit” button, which is to exit to the main menu, get_root().change_scene_to_file("path"), changes the scene but remains static, I already looked for several solutions but none of them worked ;(

It sounds like your scene tree is paused before you switch to the new scene and you may not be unpausing. Can you please share the relevant code?

get_tree().paused = true
...
get_tree().paused = false # remember to unpause!
2 Likes

IT’S TRUE!!
Thank you very much, I had not realized that the game was still paused, how stupid I am hahaha, thanks for solving my doubt!!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.