- Home /
Unity hideflags - hide in hierarchy but still render in scene
Hey guys, I am making some editor tools. An object has a monobehaviour that takes in an array of gameobjects and draws lines from one to the other. I have an editor tool to add/delete these gameobjects 'automatically' (so the user doesnt need to manually populate the list themselves). these objects are instantiated, and childed the the main object. I want to prevent the user from moving them around the hierarchy, but I do not want to stop them from moving these child objects around in the scene. HideFlags.HideInHierarchy sounds like what I want, but it hides everything.
So what else can I do to prevent the user from altering a hierarchy of objects? This is just a simple example, but I can easy imagine a real world situation where the monobehaviour relies on the ordering of its children (or something like that), and dragging the objects around the hierarchy could cause problems
Answer by Prodigga · May 16, 2013 at 01:41 AM
I figured out a solution to this problem. Basically, if you child all objects that you want to hide in the inspector to an empty game object, and hide that game object (HideFlags.HideInHierarchy), then it will remove that object and all its children from the hierarchy, but its children will still render in the scene (and remain intractable) as they are not hidden.
Your answer
Follow this Question
Related Questions
How to hide parent in Hierarchy and maintain child? 0 Answers
Cant hide anything in Hierarchy IDE 2 Answers
Unity Hierarchy never saves order 1 Answer
HideFlags on children of visible objects. 3 Answers
changing editor hierarchy icons 0 Answers