|Topic was automatically imported from the old Question2Answer platform.
Do singletons reset when switching scenes? I’ve got a character customization system which saves the choices in a global script(singleton). If i print the choices after a scene switch i get the defaults.
how do you save it in singleton?
does it work before switching scene?
can you share a sample project to reproduce?
volzhs | 2018-12-28 12:00
- i made a new script and i just put it in the autoload window
- yes it works before switching the scene, it print what it should print
- i just made the script, made some variables in it, put it in autoload and then acces the variables in another script as global.something, setting them a new value
GunPoint | 2018-12-28 16:41
The question is, it is normal this behaviour?
GunPoint | 2018-12-28 16:43
I liked to know some what was wrong with your project.
what version do you use?
i would make working example project.
volzhs | 2018-12-28 17:45
I fixed it. I was resetting the global variables on _ready on an object in the new scene
GunPoint | 2018-12-28 17:57
glad to hear that
volzhs | 2018-12-28 18:50