+1 vote

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.

in Engine by (451 points)
edited by

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.

I added some more detail

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.