I want to have an object visible in the hierarchy, but hide its children. This is easily doable. But then, if I set the visibility (aka, the little eye icon), its children don’t disappear.
So I tried code. But it seems like it’s impossible to set the visibility via code for objects that are hidden in the hierarchy.
In other words, this code doesn’t work:
gameObject.hideFlags = HideFlags.HideInHierarchy;
SceneVisibilityManager.instance.Hide(gameObject, false);
As in, the object is hidden in the hierarchy but still visible in the scene.
Is there a way to do what I’m thinking?