So for an inventory, I have the game scene and an inventory scene. When I press f, the game is paused and the inventory pops up. Then when I press f again, I used “go back to a previous scene”. This ensures that the progress in the game is saved and is resumed perfectly when I exit the inventory. However, the inventory scene is not ever saved, causing all items to dissapear. When I coded both to “pause and switch scene” neither scene is saved when the switch occurs. How do I make it so I can pause one scene, go to another, and then return to the first scene, with both scenes’ data being saved and continue the progress which has occurred in them?
save data in global variables
If you want for the inventory to be persistent even if the game closes, you need to use Storage.
If you only need the inventory to persist just in the gameplay use globals.