Godot scene singleton being weird.

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

When I have a scene autoloaded and then I change a label inside the scene, the label still has the original text and the new text which makes me think that the scene is 2 stacked on top of each other. My default scene is the main.tscn which I autoloaded so that might be the problem but I do not know how to fix it. I want it so that when I do something in the scene then switch to another scene then back I want it to be the same.

I don’t think it’s meant to have your default scene script as a singleton. Singletons are basically a glue between your scenes. You should add a singleton SceneVariables.gd, and remove your default scene from autoload. And then store the shared variables in SceneVariables. I think that what happens in your case is that your scene is once instanced as a normal scene instanced and script is used again as autoloaded singleton. So you have 2 instances. You should provide more info about your problem and what you want to achieve in order to get a suitable answer.

gmaps | 2019-09-17 08:12

I added some more detail

jujumumu | 2019-09-17 22:45