Getting the previous scene

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By ispilantebrusli

Hi, im trying to make a save/load menu for my game.
For example, im in the current level, press ctrl+s to save and then pops up a menu with multiple slots (you can choose in which one u want to save it), how can I get the path of the current level ?

Idk how to post the image directly here, im sorry

get_tree.current_scene.filename

To get the path of the current scene.
If you want to access previous scenes, everytime you save a scene, save the filename of that scene to a list or dictionary. And then you can access it through the list/dictionary.

TheJokingJack | 2021-08-22 15:54

:bust_in_silhouette: Reply From: MisterMano

You’ll probably want to take a look both into the Saving Games doc:

And PackedScenes:

The latter is what you’ll need to save the scene “as is”.
Similar question: https://forum.godotengine.org/903/how-to-save-a-scene-at-run-time