0 votes

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

Godot version 3.3.2
in Engine by (32 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 (56 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 (1,051 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 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 webmaster@godotengine.org with your username.