Keeping setting changes when changing scenes

I’m trying to set my events to where when a player has customised the settings to their liking, once they go to another scene it saves. That’s cool and all, however when I return to the settings page, the customisations would reset. How do I avoid this? Here’s a pic of my code when the scene starts.

Hope this question is understandable :sweat_smile: Sorry if I keep asking a lot

How are you saving the settings? You’ve hardcoded the animations and volumes. You should be reading the values you’ve saved and use them instead of setting every animation to 7 and the volumes to 70 & 33.

oh maybe i should’ve showed this instead, not sure

Hello @p.iinksoda
if you save the settings into global variable you don’t reset then on scene change but you miss the data on quit game.
If you need to save the informations into the PC I suggest you to transform the variable ito JSON and save in a local file.

1 Like

I would recommend storing your settings and information into a Global structure variable so it persists between scenes, then following this process to save your data so it persists between game sessions:


No, this is not saving or storing the settings.All this is doing is changing values for the scene. Once you change scenes, the animation changes are lost, and when you open the settings scene again, the default values that you set are used.

A few notes on those events :

  1. You should check that the animation is greater than 0 before reducing it.
  2. Put the trigger once in the same event condition as the cursor check and touch/LNB down.
  3. You can simplify all those volume settings to one event :
1 Like

Use Storage with 3 lines of code is solved

1 Like

Tried following the video, clearly doing something wrong here, I’m very lost :sneezing_face:

(first two screenshots are in the same scene fyi)

hey so i realised that my main problem rn is that whenever i set the settings in one scene and change it to another, if i were to return back to that scene the settings would reset

i’m assuming it has something to do with the global variables and the values of the sprite, but im not so sure.

If you are saving and reading the settings with the events you posted earlier, then no wonder.

You’re saving to storage “SettingsSaveState”, but reading from storage “Settings”.

Fixed it and nothing has changed :pensive: The settings still reset whenever I go back to the Settings Scene. Yk what I’m leave it like that for now and focus on other aspects of my game, I’ll come back to it once I feel like it.

I still don’t understand why it resets. Thanks for the help btw

If you don’t mind, I’d rather nut this out and get it working. It’s relatively straight forward to do, so there’ll be something that’s been overlooked.

Also, in this event, the loading values appear to be done in an unconditional event, and so will get run every frame. So you can start by putting the load from storage and copy to variable actions into an “At the beginning of the scene” event :

Done, well the changed definitely stayed when I switched to different scenes. Still resetting when I return to the settings page though

Can you post screen snips of the events of the settings scene? And also one of the other scenes that it does seem to work for?


First screenshot is settings page
Second is menu page where it did work

Nowhere in the second image can I spot a reference to the global variable Settings, other than when it’s set at the beginning of the scene.

All the volume values are set to 75 :


You need to replace these values of 75 with GlobalVariable(Settings.MusixVolume) or GlobalVariable(Settingsd.UIVolume).

Edit - typos corrected :
You need to replace these values of 75 with GlobalVariable(Settings.MusicVolume) or GlobalVariable(Settings.UIVolume).

Tried it, yet it’s still the same :sob:

Can you show screen captures of the events? And note, I made some typos in my previous reply.

Screen captures of which events? All of them?

The menu page scene.