Thanks for the reply, Richard — I really appreciate the detail. These kinds of insights are critical, as I’m always looking to improve performance.
Unity is optimised for independent objects - characters, props, etc - each being separate roots in the scene.
This design choice surprises me. In open-world games, it’s common to manage tens of thousands of GameObjects with colliders. My current test scene contains around 250,000 GameObjects. If I understand correctly, optimal performance comes from placing each object at the root level of the scene. That’s the opposite of my current structure — and understandably so, since putting thousands of GameObjects at the root would likely freeze the editor and make the hierarchy unmanageable.
The pathologically worst case for this is to pack all your GameObjects into a single massive hierarchy. I don’t see people do that very often
So, to clarify, you’re saying it’s better (performance-wise) to have asteroids (space) and trees (planets) mixed at the root level, rather than organizing them into logical scene hierarchies? I’m currently using two separate scenes with two separate PhysicsScenes — one for space and one for planetside — which seemed like a clean separation.
By putting e.g. all your animated characters as children of a single ‘Characters’ GameObject, you’re putting them all in the same TransformHierarchy, and you’re blocking the engine from working on them in parallel.
That’s an unfortunate limitation, especially for my game design where animated characters (using kinematic controls) are physically on starships. It makes sense to parent characters to ship transforms, both for logic and motion coherence. Given the need to preserve that transform relationship, is there any viable alternative?
The current design works well in Unity 2022.3.x and gives great runtime performance.
e.g. a player created voxel starship with animated characters in the transform hierarchy
At the very least: if you want to use GameObjects in this way for authoring your scene, set up scripts to ‘unpack’ the folders when building or starting the game, so that the things in the folder become separate root transforms in the scene. At least that way you’ll only be paying the performance cost in the Editor, not at runtime.
Since everything in my game is generated procedurally at runtime, I can certainly flatten the hierarchy more during runtime initialization. However, the Editor performance remains a concern — placing thousands of root objects often causes the hierarchy window to lock up or become unresponsive.
e.g. tons of colliders, and also an animated character, all under the same root).
My game is likely very sensitive to changes in collider performance. Players can build complex structures composed of tens of thousands of blocks. That’s by design — I process these structures by analyzing and reducing them into a minimal set of polygons, grouped by material, for rendering. This lets me render over a million blocks with excellent performance.
For physics, I use a multithreaded algorithm that analyzes each structure and greedily reduces it into a near-optimal set of combined box colliders. Each structure is represented by a single GameObject with one Rigidbody and hundreds (or thousands) of box colliders.
The screenshot below shows one of these player-created objects — a starship — and the hierarchy generated for it.
Performance in Unity 2022.3 LTS is solid. However, in Unity 6000.x, it degrades significantly.
e.g. a player created starship, with combined renderers (single mesh per material) and colliders.
e.g. a runtime combined mesh
e.g. coalesced colliders of varying size, grouped into a near optimal set.
Given the current engine limitations — and anticipating possible future changes in the physics or transform hierarchy systems — how would you recommend structuring this hierarchy for optimal performance?
As noted, there is a change being tested to bring performance for this back towards 2022LTS-equivalent levels, because we didn’t intend to regress performance in 6, and we don’t want upgrading to 6 to mean you’re forced to restructure your scenes right now.
Thank you. I really appreciate the team’s attention to maintaining compatibility and performance expectations across versions.