Hi, I am having an issue with my main menu scene. I have a main menu set up with two buttons, one that loads the main level and one that exits the game. Within my game level, I have a button that exits back to the main menu. I am using the function change_scene_to_packed() to do this. Upon starting the game, the main menu works as normal. The play button loads the level and the exit button closes the game. Upon loading into the main level, everything also seems to work as normal.
The problem is, upon returning to the main menu using the exit button in the level, the main menu scene seems to not function. The scene visually appears to load as the text, background, and buttons all appear. The buttons animate properly when pressed, but nothing happens. In the main menu script’s _ready function, I put a test print statement. The statement prints when starting the game initially, but not when loading to the menu from the level. Its as if the main menu is not executing its script when being loaded from the level, but I’m not sure why.
I saw someone with a similar problem who was pausing their game without unpausing it, which was causing the issue. As far as I understand, this is referring to the Scene Tree’s ‘paused’ property, but I don’t have any code that changes this property.
This is the code in the level script that changes the scene back to the main menu
It seems as a new forum user I am only able to upload one image, so I figured the code in the level script that loads the menu would be the most relevant. I also have the snips of the main menu script and the script for the UI within the level, so please let me know if any of you want to see those or anything else in the project.
I am a beginner, so any suggestions are appreciated.