Regarding setActive

Hi, I have an issue that I can’t find a solution for it, I have two panels on top of each other and depends on a button press I do setActive(true) and the other is false the problem is when I go to different scene and go back to this scene the change isn’t saved and I go back to what it was originially any helpful tips please?

Whenever you load a scene, it loads at how you left it when you last saved. That means if you change something and don’t save the scene, it will now save the change.

You would need to save the setActive state to disk, or a singleton that remains alive between scenes.

If you want to do a permanent save (between robots of your computer) you need to save to disk. One easy way is to you “PlayerPerfs” to save and load the state.

A singleton object can store between scenes but requires a little bit more programming knowledge.

To save data between Scenes, its easy to use

PlayerPrefs.SetInt("VariableName", VariableValue);
int HealthorWhatever = PlayerPrefs.GetInt("VariableName");

That data also saves when you exit, Its useful for savegame.
But if you’re saying the scene isn’t saved, save the scene with Ctrl+S

You can use the PlayerPrefs for that. You should try and keep it small from what I remember.

You can use this to save data across sessions (and thus scenes). It only saves ints, floats and strings though, so you might need to get a little creative to make it save and load a GameObject’s Active state.