0 votes

in GDscript when I switch scenes my variables reset. how do I fix this.

Godot version 3.3.2
in Engine by (34 points)

2 Answers

0 votes

When you go to project settings there is an option for Autoloads and Singletons, I'm new so I don't really know how that works but I know you can have a scene running in the background, like you have your current scene and your autoload scene. Hope that helps a little bit.

by (61 points)
+1 vote

Autoload is the way to go here. This article from the docs explain everything you need to know in a not very technical way. https://docs.godotengine.org/en/stable/getting_started/step_by_step/singletons_autoload.html

by (2,003 points)
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.