Hazel

Scenes and the Hierarchy

A scene is one level, menu or screen of your game, saved as a .bsn file. The Hierarchy panel lists everything in the scene you have open, as a tree: objects can sit inside other objects, and moving a parent moves everything inside it.

The Hierarchy with a small scene: the default camera's gold star, a script badge on crate, eye and lock icons on the right

Scenes

Which scene am I in?

The top bar names the open scene, after your project name: my_game / main. Click it to open the scene switcher.

The switcher has a search box, then two columns:

  • Project scenes: every .bsn in your project's scenes/ folder. Click one to open it. Each row has a play button (Play this scene) and a star: the filled star marks the boot scene, the one your game starts on. Click another scene's star to make it the boot scene.
  • Open: every document you have open (scenes, materials, scripts), with Save and Close buttons.

New Scene is in the Project scenes column, and Open Scene File... in the Open column.

The status bar, bottom left, says Saved or Unsaved next to Ready.

New, open and save

ActionWhereKey
New SceneMenu > File, or the scene switcherCtrl+N
Open SceneMenu > File, or the scene switcherCtrl+O
SaveMenu > File, or the floppy disk in the top barCtrl+S
Save AsMenu > FileCtrl+Shift+S

Save As saves a copy under a new name and carries on editing the copy.

If you try to close the editor, or switch project, with unsaved changes, the editor asks first.

Auto-save

Auto-save is on by default and saves the open scene every 300 seconds. The status bar counts down in place of Ready. Change the interval, or turn it off, under Settings > Auto-Save.

Play also saves. Your game reads the scene from disk, so pressing Play saves the open scene first (see Playing your game).

The boot scene

The boot scene is where your game starts. Set it with the star in the scene switcher, with Set as Boot Scene in the Inspector when nothing is selected, or under Settings > Project > Boot Scene. Editing a different scene never changes the boot scene.

The Hierarchy panel

An empty scene

When a scene has nothing in it, the Hierarchy offers starters instead of a blank list:

StarterWhat you get
Empty SceneJust a camera
2D SceneA 2D camera, and the viewport switches to 2D
New EnvironmentSun, sky, fog and a sculpted landscape with a camera looking across it
New UI CanvasA canvas for game UI

Below them is a row of common objects (Cube, Sphere, Plane, Light, Camera, Empty) that add one thing each.

Adding objects

Click Add Entity at the top of the panel. A searchable list opens with everything you can add, grouped by category: empty objects, lights, cameras, shapes, terrain, the world environment, UI and more. Type to narrow it down, then pick one.

The Add Entity list, grouped by category

Right-click empty space below the tree for the same list. Right-click a row and use Add to put the new object inside that one.

Searching and filtering

The Search entities... box filters the tree by name. The funnel button beside it filters by what objects contain, such as only lights or only meshes. Clear filter shows everything again.

Each row

PartWhat it does
CaretOpen or close the branch
IconWhat kind of object it is
NameDouble-click the name (or press F2) to rename
BadgesSmall icons for an attached script or material
EyeHide or show the object in the editor
LockLock it, so clicks in the viewport pass through it

The eye hides an object while you edit. It stays visible in the game unless you turn on Settings > Project > Hidden Objects Stay Hidden in Game.

A gold star after a camera's name marks the default camera, the one the game looks through.

Selecting

What you doWhat happens
Click a rowSelect it (and, by default, open its branch)
Ctrl + clickAdd it to, or remove it from, the selection
Shift + clickSelect every row between the last one and this one
Drag across empty space below the rowsBox-select the rows you sweep over
Up / DownMove to the previous or next row
Right / LeftOpen or close the branch, then step into or out of it
Ctrl+ASelect everything

If you would rather clicking a row did not open its branch, turn off Settings > Interface > Toggle on Click.

When you scroll down a deep tree, the parents of the top row stay pinned at the top of the panel so you always know where you are (Settings > Interface > Parent Stacking).

Parenting and reordering

Drag a row onto another:

Drop onResult
The top third of a rowPlace it just above
The bottom thirdPlace it just below
The middlePut it inside, as a child

Drag several selected rows to move them together. Every move is one undo step.

Dropping assets on rows

Drag from the Assets panel:

  • A script onto a row attaches it to that object.
  • A material onto a row applies it to that object's mesh.
  • A scene anywhere on the panel adds it to the open scene.

The right-click menu

Right-click a row for:

SubmenuHolds
AddEmpty Entity, then everything you can add, placed inside this object
EditRename, Duplicate, Unparent, Group as Children (with several selected), Select as One Object / Select Parts Separately, and Separate Parts on a model part
AttachMake a new file for this object (Rust Script, Material, UI Template, Scene)
PrefabCreate Prefab, or on a prefab copy Apply to Prefab, Revert to Prefab and Unpack Scene Instance; then Instance Scene…
CameraCameras only: Set as Default Camera and Snap to Viewport (moves the camera to where the editor view is)
Label ColorColour the row so it stands out, or Clear Color
DeleteDelete the object (or the whole selection, if this row is part of it)

The right-click menu on a Hierarchy row

Select as One Object makes a click anywhere on a model in the viewport select the whole model rather than the part you hit. Select Parts Separately turns that off.

The buttons at the bottom

ButtonWhat it does
New Group (folder with a plus)Add an empty object to group things under
DuplicateCopy the selection, children included (Ctrl+D)
DeleteDelete the selection (Delete)

Prefabs

A prefab is a group of objects saved as its own file, so you can place copies of it all over your scenes.

  1. Right-click the object you want to reuse and choose Prefab > Create Prefab. It is saved to your project's prefabs/ folder, and the object in your scene becomes a copy of it.
  2. Drag the prefab from the Assets panel into your scenes as many times as you like, or use Prefab > Instance Scene… to add any scene inside an object.
  3. Changed a copy and want every copy to match? Right-click it and choose Prefab > Apply to Prefab. Revert to Prefab throws your changes to this copy away.
  4. Unpack Scene Instance turns a copy into ordinary objects that no longer follow the prefab.

Undo

Almost everything you do in the Hierarchy, the viewport and the Inspector can be undone with Ctrl+Z and redone with Ctrl+Y. See Undo and the History panel.