How to use CheckBoxes between Scenes?

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

I have a main menu scene in a game as well as an options scene. There are check boxes in the options scene that can be toggled on and off. However, if a check box is toggled off, the change is not saved (at least the graphic) when i switch back to the main menu and back again.

The options scene and main menu scene have the same script connected to them that handles all the buttons in both scenes.

Here’s a video: https://www.youtube.com/watch?v=S4rWvC66yB0

Can you please help me with the code to save the change between scenes?

You must store these values in global.gd. Take a look at Singletons (AutoLoad) — Godot Engine (3.0) documentation in English

Alex Pires | 2019-02-02 04:40

:bust_in_silhouette: Reply From: Calinou

You could probably solve this by hiding the options scene instead of freeing it and instancing it again. This way, it would probably be instanced as soon as the main menu displays, but it would be hidden at first.