Question on Saving "Hierarchy state"

Hello everyone, I’ve been wondering if there is a way to save the “Hierarchy state” when saving the scene before switching to a different one (in other words, can you save what sub-gameobjects were “open” or “closed” in the menu so when you come back into the scene, you don’t have to setup your hierarchy all over again to work on specific objects).

Perhaps this is supposed to be the default behavior but I’m not seeing it. In fact, many times the hierarchy objects seem randomly opened or closed, not sure if this is the expected behavior.

Any ideas are appreciated.

You may want to check out these two answers:

Fold/unfold gameobject from code

keep gameObject in hierarchy folded when not selected

You will likely need to track the selections made, but in reality, there is no “direct” way to get which ones are folded and unfolded in the editor. My best suggestion to you would be to organize your scene a bit more carefully, so it isn’t quite so hard to locate the important objects, or automate some of the processes that you’re taking to edit them, through editor scripts.

I created an Editor extension you can use it

The Asset Store is your friend: