- Home /
Using Empty GameObjects to organize hierarchy?
Are there any performance effects in using empty game objects to organize hierarchy view? (GameObjects as folders)
I imagine it's possible to somewhat ignore nodes that do nothing - i.e. have no mesh and have no children, so I am hoping that an empty node with a script attached is 'free'. I wouldn't imagine there'd be any empty Update() overhead as suggested below. I might fill a scene with a FPS counter and 10000 transforms to see whether the performance is hit...
Answer by DaveA · Apr 23, 2011 at 05:50 PM
If strictly for organization, I'd be sure to keep all pos/rot at 0 and scale a 1 so it wouldn't (shouldn't!) enter into any calculations, but I don't know if it's smart enough to ignore identity transforms like that. But then, I don't know that it would be a very big hit either.
Answer by Teare · Apr 23, 2011 at 08:14 PM
I've seen it used frequently as a folder hierarchy in example projects, and professional stuff like the Lerpz tutorials.
Just make sure, like DaveA said, keep the position/rotation at 0 and the scale at 1 uniformly or you might hit some inconsistencies.
$$anonymous$$y assumption is that you'll have at least the overhead of an empty Update() method call for every object that exists, whether there's script associated with it or not. In addition, that Lerpz 3D tutorial is full of inefficient code practices (needless instantiations in the GUIs, constantly re-fetching using .Find/.FindWithTag/.getComponent rather than caching at the start, and such) so I wouldn't necessarily trust it to have the most efficient project layout practices either.