- Home /
Is there any way to create folders in the heirarchy to group objects?
First, I am very aware of the "parenting things to empty game objects", which is suggested every time this problem is brought up, hopefully never by anybody who knows what they're doing.
When I say "folders", I mean something that is editor-only and has no consequences in code or games, merely helping to dig through a large project.
And when I say "create", I mean script, because this is not yet a feature in Unity at this time.
Answering the question "How can I access and explore the API for the hierarchy window to create folder-like functionality?" would be enough, I think.
I am already familiar with custom editors and custom inspectors and have many windows of my own, so you do not need to start from the basics. I won't be offended if you want to anyway -- other people with the same problem might appreciate that.
Can anyone point me in the right direction on where to start?
To avoid this question meeting the fate of every one like it I have found, please, consider the following before telling me to use empties. The question is done -- everything that follows is a PSA on using empties as folder substitute.
Problems with using empties as folders include but are not limited to:
Transform.root will return the transform of the empty you are using as a folder. Without Transform.root, you are on your own for things such as having a raycast hit an enemy's hitbox on their hand and still tell you what enemy you hit without having to, for example, shove a band-aid extension method somewhere. There are plenty of workarounds.
Parenting has overhead and consequences. These are probably insignificant until the moment you do something like start baking GI, automatic or not.
If your empty isn't (0, 0, 0) and Quaternion.Identity, rotations are bound to get more complicated, especially if you're like me and constantly forget which order to put rotation*Quaternion... in to get world space.
There are plenty of workarounds to these problems, but the best workaround I have found with the least amount of trouble and debugging steps in the long run is not using empties as folder and having to scroll a lot.
Answer by tanoshimi · Apr 16, 2017 at 04:36 PM
No, you can't. I'd suggest you vote for the following feature suggestion to add it: https://feedback.unity3d.com/suggestions/creating-folders-in-hierarchy