Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | abbos |
Hello I have defined in my game that when the ESCAPE key is pressed, the game scene is changed and the player is asked if you want to leave the game. When I press no, the scene loads again, but not progress to be save, but I want the game progress to be saved.
If you switch scene, it means you’re removing the current scene. If you don’t save the state of that scene, you’ll be back to your initial state when you switch back. You could implement a temporary scene save file when switching to your menu scene, or you could take the followong simpler approach:
- when the use press ESC, pause the game (see the official docs for that)
- show the menu scene over your current scene, instead of switching
- when the user press no, remove the menu scene and unpause the game
This way, you don’t have to save/load everytime you want to show a menu.
Bernard Cloutier | 2020-10-16 03:45
Where is this tutorial in the Godot document?
abbos | 2020-10-16 09:02
Pausing games and process mode — Godot Engine (stable) documentation in English
Bernard Cloutier | 2020-10-16 12:26
Thank youuuu my brother
abbos | 2020-10-16 14:00