Unity 7 Hierarchy: organize scene objects with parents and empty objects

Translated from the original Traditional Chinese version.

Summary

The Hierarchy window lists every object in your scene, and once there are many, a long column of names makes the one you want hard to find. Unity groups objects with parent-child relationships. Drag an object onto another object and it becomes a child that moves with its parent and collapses together with the rest of the group. You practice on the Fruit Catcher scene: creating objects, grouping them under empty objects, adding Active, Tag, and Layer columns, searching for objects, and reading the icons next to their names.

Table of contents

Everything in a game scene is an object (a GameObject): the camera, the lights, the ground, the characters, and the score text. The Hierarchy window lists all the objects in the scene. With three or five objects you can see them at a glance, but a complete small game often has dozens of rows, and finding the one you want to change takes a while. Unity organizes objects with parent-child relationships. Drag an object onto another object and it becomes a child that moves with its parent and can be collapsed together with the other children. In the Fruit Catcher scene you practice creating objects, grouping them, adding columns, searching, and reading the icons next to object names.

This is the second article in the series. It follows Unity 7 Editor tour: learn the six windows and reset the default layout and uses the Fruit Catcher project you downloaded there. I tested on Windows 11 with Unity 7000.0.0a23 (Alpha), and the interface may still change before the stable release.

Read the Hierarchy list

In the Project window, open Assets > Scenes > FruitCatcher. Hierarchy on the left lists the objects in the scene. The top row is the scene name, and each row below it is an object. An object with a triangle in front of its name has children under it, and you click the triangle to expand or collapse them:

The Fruit Catcher Hierarchy fully expanded. Environment contains Ground, Background, TreeLeft, and TreeRight. Gameplay contains Basket and FruitSpawner. UI contains Canvas and EventSystem. GameManager is last

The Fruit Catcher scene sorts its objects into groups. Each group is an empty object that holds one kind of thing:

Object What it holds
Environment The ground, the background, and the trees, which never move
Gameplay The basket and the object that spawns fruit
UI The score and lives display: a Canvas, which holds the on-screen text, and an EventSystem, which passes input to the UI
GameManager The script that manages the score, the lives, and the restart

The camera, the light, and Global Volume, which adjusts screen effects, were already in the project when it was created, so they sit at the top level. When you want to change the basket, expand Gameplay. When you want to change the background, expand Environment. Keep the other groups collapsed, and the list is only a few rows long.

Create objects

Now practice in a scratch scene. Open MyFirstGame, the empty 3D project you created in Claude & Unity project creation: create your first 3D project and run the game in the Editor, or open a new scene in the Fruit Catcher project with File > New Scene. Don’t save the practice scene (choose Don’t Save when Unity asks), and the original scene isn’t affected.

Click the “+” at the top left of Hierarchy, or right-click an empty spot in Hierarchy. Either one opens the menu for creating objects:

The “+” menu in Hierarchy, listing Create Empty, 2D Object, 3D Object, Visual Effects, Light, Audio, Video, UI Toolkit, UI (Canvas), Camera, and more

3D Object > Cube creates a cube. Create Empty creates an empty object that holds only position information (shortcut Ctrl+Shift+N). After a new object is created, its name is ready for editing, so type a name and press Enter (Create GameObjects). Create a Cube. Then create an empty object and name it Group. These two objects are for the next steps.

Drag an object to make it a child

In Hierarchy, drag the Cube onto Group and release. The Cube indents under Group and becomes a child of Group:

Before dragging, Group and Cube are at the top level of the scene, like Main Camera and the other objects

After dragging, the Cube is indented under Group, and an expand triangle appears in front of the Group name

A child moves, rotates, and scales with its parent. Select Group in Hierarchy and change its Position in Inspector, and the Cube moves too, with the distance between them unchanged (Parent-child relationships). To remove the relationship, drag the Cube out of Group and drop it at the top level.

When several objects belong in the same group, you don’t have to drag them one by one. Select them in Hierarchy, right-click, and choose Create Empty Parent (shortcut Ctrl+Shift+G). Unity creates an empty object and puts all the selected objects under it (Manage GameObjects).

Group objects under empty objects

Leave an empty object that only groups other objects at the origin: Position and Rotation are 0, and Scale is 1. The position Inspector shows for a child is its distance from the parent. When the parent is at the origin, the child’s numbers equal its real position in the scene, so you can read a child’s position directly when you adjust it later.

Name the groups with the rules in Unity 7 project folders: sort assets by type and use one naming rule: English, each word capitalized, no spaces, such as Environment and Gameplay. When you ask Claude to add objects to the scene, you can also say which group they belong in. For example, “Put the new fruit spawner under Gameplay.”

Add Active, Tag, and Layer columns

At the top of Hierarchy is a row of column headers. By default there are only three: Visibility (the eye), Picking (the hand), and Name. Right-click a column header to add more columns:

The menu after right-clicking a Hierarchy column header. Visibility and Picking are checked, Name is grayed out, and below them are Active, Tag, Static, Layer, and Reset Columns

After you check Active, Tag, and Layer, Hierarchy gains three columns. Active is the checkbox that turns an object on or off. A Tag is a text label on an object, and a Layer is a category that cameras, lights, and physics can include or ignore. These columns show something only when an object’s setting differs from the default, so objects with special settings stand out. For example, Main Camera has the Tag MainCamera, Canvas and the text under it are on the UI layer, and GameOverText, which isn’t active yet, shows an empty checkbox in the Active column:

Hierarchy with the Active, Tag, and Layer columns added. Main Camera has the Tag MainCamera, Canvas and the three text objects are on the UI layer, and GameOverText shows an empty checkbox in Active

To go back to the default columns, right-click a column header and choose Reset Columns (Configure the Hierarchy window).

These column headers have been in Hierarchy only since Unity 6.3. If your Hierarchy has no column headers and every object has the same gray square in front of it, the project is using the legacy Hierarchy:

The legacy Hierarchy, with no column headers and the same gray square icon in front of every object

Go to Edit > Project Settings > Editor and clear Use Legacy Hierarchy. Hierarchy switches back to the new version immediately, and you don’t need to reopen the Editor:

The Editor page of Project Settings. In the Hierarchy section, Use Legacy Hierarchy is not checked

Search for objects

You can type an object name in the search box at the top of Hierarchy. Type t: followed by a component name (a block in Inspector, such as Rigidbody) to list every object that has that component. For example, with t:Rigidbody, the Fruit Catcher scene lists only Basket, because the fruit is spawned after you press Play:

Hierarchy with t:Rigidbody typed in the search box. The right side shows 1 result, and below the FruitCatcher scene row the list shows only Basket

Clear the search box and Hierarchy goes back to the full list.

Read the icons next to names

The small icon in front of an object’s name shows its type. These are the ones you see most often (Hierarchy window reference):

Icon What it means
Blue cube An instance of a prefab, and the name is blue too. A prefab is an object template saved as a file, such as Apple in Fruit Catcher
Red cube with a crack The prefab file was deleted, and the name turns light red
Gray blank document The script on the object can’t be found, usually because the script file was deleted or renamed, and the name stays white
Other icons Depend on the components on the object, such as a camera or a light

The Fruit Catcher scene has no prefab instances, because the fruit is spawned by a script after you press Play. To see the blue cube icon, drag Apple from the Prefabs folder in the Project window into Hierarchy. A “>” for opening the prefab also appears at the far right of the name. Delete the object when you are done looking. The screenshot below comes from a separate practice project (see Test notes), so it shows a different scene:

Apple and Banana in Hierarchy are prefab instances. Their names are blue, they have a blue cube icon in front, and there is a “>” at the far right

A red cube or a gray blank document icon means a file in the project is missing. An object whose script can’t be found keeps a white name and has no other warning symbol, so only the icon tells you:

The broken prefab instance Banana shows a red cube with a crack and a light red name. ScriptGone, whose script can’t be found, shows a gray blank document icon

The Visibility (eye) and Picking (hand) columns on the left affect only the Editor. If you turn off the eye, the object is hidden in the Scene window for now, but it still shows in the Game window when you press Play. If you turn off the hand, you can’t select the object by accident in the Scene window. When there are many objects and you want to focus on one, use these two columns to hide the others for now:

The eye column of Environment is crossed out and the Scene window shows only the basket, and the hand column of Gameplay is crossed out too

Test notes

Item Details
System Windows 11, physical machine
Editor Unity 7000.0.0a23 (Alpha)
Project stage-4-score branch of tedliou/claude-unity-fruit-catcher

I opened the same sample project in Unity 6000.6.10f1 to compare, and its Hierarchy has the same column headers: Visibility, Picking, and Name. I took the prefab icons, the broken icons, and the legacy Hierarchy in a separate practice project, where Apple and Banana are prefabs I made on the spot from a sphere and a capsule.

Summary

With Hierarchy organized, the next step is to organize the files in Project with the same rules in Unity 7 project folders: sort assets by type and use one naming rule. The Fruit Catcher scene has 22 objects. After I grouped them into Environment, Gameplay, UI, and GameManager as in this article, the top level had only 7 rows.

Further reading

Ted Liou

Ted Liou

Software engineer writing about Unity and AI development.

Comments