I don’t think it writes to any sort of non volatile storage unless you SaveGameToSlot. If your intention is to retrieve the changes written to the variable at a later time after an app restart, just setting the variable will not do it for you.
Yeah I know that game won’t be saved if I don’t SaveGameToSlot in the end.
So if I just change variables there will be no problem with writing to disk too frequently?
The question here would be why you would want to save every time something changes? You could create an auto-save every few minutes which would be better IMO or simply let the player save when they want to save (or both). I’m sure you could make your own I/O thing to write to disk but I don’t think a game would benefit from this and I wouldn’t know how to do this myself.
What hedgie17 said ^^. You could also make a slider in the settings of your game to set an autosave interval.
Changing it every second would be bad practice imo.