- Home /
Using empty gameobjects as "folders" in scene hierarchy panel
I typically drag and drop GameObject's into public variables in the component inspector.. Are there any downsides to using an empty GameObject as a "folder" to organize my scene hierarchy, especially for complex multi-object scenes?
keep in $$anonymous$$d that an un-childed object is parented to the world, so if you child it to something else, the hierarchy is affected in that sense. Not necessarily a "downside", but I expect certain confusing issues could arise
As Seth mentioned it can complicate chaining of transforms, but if your empty GameObject is at in the absolute center of the world and at unit-length scale with no rotation, then you'd never notice it. Your children are still, effectively, in world coordinates.
If your centre transform has non-uniform scale, it can cause weird problems. Basically it's not an issue as long as all your code is written keeping it in $$anonymous$$d.
Actually, now that I think about it, if the centre transform has a scale of (0, 0, 0), that would kind of break everything, but I'm sure you won't do that.
how about: default empty GameObject as the "root" gameobject "folder" ?
I usually have a GameObject named "_" in my scene, pos (0,0,0) rot (0,0,0) and scale (1,1,1). I use it to store things like walls, terrains, lights etc. Works quite all right.
Answer by philstrahl · Apr 01, 2016 at 05:45 PM
I guess I'm late to the party but if can, avoid it. The thing is, that every GameObject allocates memory for properties, functions, etc, even if it's just used as a "folder". Depending on how many you have, especially on mobile, this might lead to performance and/or memory issues.
Do i have an alternative for that? No. I wish there was a simple "Bin" type or similar.
Your answer
Follow this Question
Related Questions
Best workflow for DontDestroyOnLoad method regarding Unity Editor? 1 Answer
Monodevelop deleted my hierarchy/scene 2 Answers
I have an error, script should check for null or not destroy game objects 2 Answers
good resource about conserving memory when multiple levels share resources? 0 Answers
Overwrite the inspector window on Scene Asset heading chosen in the hierarchy window 0 Answers