i have a menu that pops up once the player loses, that can send them to the main menu, retry the game or send them to an upgrade tree, the problem is that once i switch back to those scenes ( for example the main menu scene ), the buttons stop working, they do work normally if i start the game on those scenes tho
You might have a circular dependency if you use a PackedScene like this.
Say Scene A references Scene B, and Scene B references Scene A so you can go back and forth. As far as I know, Godot is REALLY not happy with things like this.
I recommend using the scene’s UID instead, and dynamically loading it then setting it as the current scene.
i tried this and it still didnt work, the first scene switch in the game over screen works, but once i get to the menu the button still cant be clicked
Are you able to confirm that the button is being pressed?
Does the “pressed” string get printed at all? And when they do stop working, do you get any warnings or errors in the console?
the button doesnt run the switch_to() function once it gets clicked, but it does print “a” (its in the ready function), whats weird is when i hover over the button it doesnt even get highlighted, so i dont know what could be the problem.
That means another Control node is blocking your button, you likely loaded some kind of HUD or other menu element(s) that stay even after you switch your scene back. If you launch your game and get to that state where your button doesn’t work, try clicking it, then open up Godot’s debugger and go to the “Misc” tab, you will be able to see what you actually clicked on, and you can figure out how to remove it.