Any way to prevent Hierarchy window from collapsing when entering Play mode?

File a bug report then.

In combination with @Baydogan 's answer I’m using this solution to select the game object I’m working on:

#if UNITY_EDITOR
        UnityEditor.EditorGUIUtility.PingObject(gameObject);
        UnityEditor.Selection.activeGameObject = gameObject;
#endif

It selects the object in the hierarchy and also selects it in the inspector on the right for easy access to script values.
You can paste this in the Start method of your script.

4 Likes

This is still occurring in Unity 2023.1.11f1 on Intel based Mac, and it seems totally related with Addressables (v1.21.17) package for me as well.
I was using in Addressables Group window under Play Mode Script as “Simulate Groups (advanced)”.
Then thanks to @elfasito , I switched it to over “Asset Database (fastest)” and it solved problem for me as well.

1 Like

Thanks from the future! :slight_smile:

There’s a Like button on every post so you can express appreciation without dragging old dead threads up in everyone’s feed.

Sorry for being appreciative!
Ups… I did it again!

This is still an issue

Agree. Someone above mentioned to find some option in Addressables Package. I didn’t even had it. Got it. And so far it stopped refreshing and closing the Hierarchy every time I hit play mode. Try this solution.

Just click windows layout 2 by 3 and you can see hierarchy while in play mode, if you want to get it with just 2 you could make a custom layout but that might take a few minutes

Is there a bug report for this I can follow? It seems to still be an issue in Unity 6000.0.28f1