The Unity Editor: Scenes, GameObjects, Components & Prefabs
Find your way around the Unity Editor, then build scenes out of GameObjects and components, place them precisely with the Transform and snapping tools, and turn what you build into prefabs, variants and nested prefabs you can reuse.
- Study time
- 6–8 hours
- Reading time
- 76 min read · 13,489 words
- Courses merged
- 2 course files
- Your progress
- —
- Name every window in the default layout and what it's for, and rearrange, save and reset layouts
- Move around the Scene view quickly with the View tool, flythrough mode, framing and the Orientation overlay
- Explain the GameObject and component model, and add, configure, copy and remove components in the Inspector
- Position, rotate and scale objects precisely using local and world space, parenting, pivots and snapping
- Create, save and organise scenes and assets, and choose which scenes go into a build
- Make prefabs, edit them in Prefab Mode, and use overrides, nested prefabs and variants without losing work
- Use Play mode to test changes, knowing which changes are thrown away and which are kept
- Build a small diorama from primitives and prefabs, with two scripts that bring it to life
The Unity Editor is where you assemble a game: you place objects, give them behaviour, and test the result without leaving the program. It looks crowded the first time you open it, but it's built on one simple idea, and once you see that idea every window makes sense. This chapter teaches that idea, then each window and tool in turn, and ends with a small island diorama that uses all of them.
You don't need to know any C# yet. The guided build has two short scripts, and you'll copy them in and use them as ready-made components. T03 · C# Fundamentals: Types, Logic, Methods & Classes and T05 · Scripting in Unity: Lifecycle, Serialization, Coroutines & Awaitable explain every line of them later.
The big picture#
Everything in a Unity game is built from three things:
- Scenes. A scene is one space in your game: a level, a menu, a test room. It's saved as a file (
Level1.unity) and it contains a list of GameObjects. - GameObjects. A GameObject is anything in a scene: a player, a wall, a light, a camera, an invisible trigger. On its own, a GameObject does nothing. It's an empty container with a name and a position.
- Components. Components are what make a GameObject something. A Mesh Renderer makes it visible, a Collider makes it solid, a Light makes it shine, a Camera lets it see, and a script you write makes it behave your way. A GameObject is whatever its components make it.
Around those three are assets: the files in your project's Assets/ folder that scenes use, such as meshes, textures, materials, sounds, scripts and prefabs. A prefab is a GameObject saved as an asset, so you can place copies of it in many scenes and change them all at once.
This is called composition: instead of a "Lighthouse" type with lighthouse powers, you take a plain GameObject and attach the pieces you need. Want the lighthouse to spin? Add a Spin component. Want it to make a sound? Add an Audio Source. The same pieces combine into anything, and a script you write is just one more piece.
A tour of the Editor#
Open your project from T01, or create a new Universal 3D project. Its sample scene opens with three GameObjects: a Main Camera, a Directional Light (the sun), and a Global Volume that holds post-processing settings. The default layout looks like this:
The six windows you'll use every day#
| Window | What it shows | You use it to |
|---|---|---|
| Hierarchy | Every GameObject in the open scene, as a tree of parents and children | Create, select, rename, reorder and group GameObjects |
| Scene view | The world, seen through a free editing camera | Look around, select objects, move, rotate and scale them |
| Game view | What the scene's camera sees, as the player will | Play and test the game |
| Inspector | The components and settings of whatever is selected | Change values, add and remove components, edit import settings |
| Project | The files in Assets/ and Packages/ | Find, create, organise and import assets |
| Console | Log messages, warnings and errors (Ctrl+Shift+C) | Read what your code and Unity report, and jump to the line that caused it |
Selection is shared. Click a GameObject in the Hierarchy and it's selected in the Scene view too, and the Inspector shows it. Click an asset in the Project window and the Inspector shows that asset instead. When something seems to be missing from the Inspector, check what's selected.
The toolbar#
Across the top is the main toolbar. The controls you'll use most are the Play, Pause and Step buttons in the middle, the search button (Unity Search, also on Ctrl+K), Undo History, and the Layout dropdown. The rest give you your account, the Asset Store, the Package Manager, cloud services and Unity's AI tools.
Arranging windows and layouts#
- Move a window by dragging its tab. Drop it on the edge of another window to dock it beside, or on the tab bar to stack it as another tab.
- Maximise the window under the mouse with Shift+Space, and press it again to restore. It's the quickest way to get a big Scene view for a minute.
- Open more windows from Window > General, or from any window's ⋮ menu > Add Tab. You can have two Inspectors, two Scene views or two Project windows.
- Save a layout from the Layout dropdown > Save Layout. Studios often keep one layout for building levels, one for animation and one for coding.
- Reset when everything is a mess: Window > Layouts > Default (or the Layout dropdown).
Moving around the Scene view#
The Scene view is a window onto your world through an editing camera that only you see, called the Scene Camera. Moving around quickly is the single most useful Editor skill, so practise the controls until you stop thinking about them.
The controls#
| To | Do this (3-button mouse) | Notes |
|---|---|---|
| Fly like a game camera | Hold the right mouse button, then move the mouse to look and use W A S D to move, Q E down and up | Hold Shift to go faster. Scroll while flying to change the speed |
| Orbit around a point | Alt + left-drag (macOS: Option) | Orbits the current pivot, usually the last thing you framed |
| Pan | Middle-drag | Or select the View tool (Q) and left-drag |
| Zoom | Scroll wheel, or Alt + right-drag | Zooming moves toward the pivot, so frame something first |
| Frame the selection | F with the mouse over the Scene view | Also Edit > Frame Selected. Double-clicking an object in the Hierarchy does the same |
| Follow a moving object | Shift+F | Edit > Lock View to Selected. Useful in Play mode |
| Walk | Arrow keys | Up and Down move forward and back; Left and Right pan sideways |
On a laptop without a middle button, pan with Alt+Ctrl + left-drag (macOS: Option+Cmd). On a Mac trackpad, drag with two fingers to zoom.
Overlays#
The small floating toolbars inside the Scene view are called overlays. By default you get:
- Tools: the transform tools (Move, Rotate, Scale…), covered below.
- Tool Settings: options for the current tool, including the Pivot / Center and Local / Global handle settings.
- Grid and Snap: the grid and snapping controls.
- Draw Modes: how meshes are drawn (shaded, wireframe, and debug views).
- View Options: the 2D toggle, lighting, audio, effects such as the skybox, scene visibility, which layers to show, the Scene Camera settings (including its speed), and gizmos.
- Orientation: the axis widget in the top right corner.
Press ` (the key above Tab) with the mouse over the Scene view to open the Overlays menu, where you can show and hide each one. Drag an overlay by its handle to move it, or dock it against an edge.
The Orientation overlay (older tutorials call it the Scene Gizmo) is worth learning. Click one of its coloured arms to look straight along that axis: the green Y arm gives you a top-down view. Click the cube in the middle, or the label under it, to switch between perspective (things further away look smaller, as in real life) and orthographic (no perspective, like an architect's drawing). Orthographic side and top views are the easiest way to line things up exactly.
The Scene Camera isn't your game camera#
Moving around the Scene view never changes what the player sees. The player sees through a GameObject with a Camera component, usually the Main Camera, and the Game view shows that. To make the game camera match your current view, select the camera and choose GameObject > Align With View (Ctrl+Shift+F). It's the easiest way to frame a shot: fly to a nice angle in the Scene view, then align the camera to it. The Cameras overlay can also let you look through and steer a scene camera directly from the Scene view.
GameObjects#
Create GameObjects from the GameObject menu, or by right-clicking in the Hierarchy. The most useful entries:
- Create Empty (Ctrl+Shift+N): a GameObject with only a Transform. Empties are used as folders, pivots and spawn points.
- 3D Object: ready-made shapes (called primitives) with a mesh, a renderer and a collider already attached.
- Light, Audio, UI, Camera, Effects: GameObjects pre-built with the right component.
Primitives have exact sizes, which makes them handy as measuring sticks while you build:
| Primitive | Size at scale 1 | Good for |
|---|---|---|
| Cube | 1 × 1 × 1 | Walls, crates, steps, blocking out a level |
| Sphere | 1 across (radius 0.5) | Balls, planets, projectiles, tree tops |
| Capsule | 1 across, 2 tall | A stand-in for a character (a person is about 1.8 m tall) |
| Cylinder | 1 across, 2 tall | Posts, pillars, towers, wheels. Its collider is a capsule, not a cylinder |
| Plane | 10 × 10, flat on the XZ plane | Floors. Only visible from above |
| Quad | 1 × 1, flat on the XY plane | Signs, screens, simple billboards. Visible from one side only |
The GameObject header#
Select a GameObject and the top of the Inspector shows settings that belong to the GameObject itself rather than to any component:
- Active checkbox, left of the name. An inactive GameObject is switched off completely: not drawn, not colliding, its scripts don't run. Inactive objects look faded in the Hierarchy.
- Name. Names don't have to be unique, but clear names save you time. Rename with F2 (macOS: Enter).
- Tag. One word that marks what the object is, such as
PlayerorCollectable, so scripts can recognise it. A GameObject has exactly one tag. - Layer. A number from 0 to 31 that systems use to include or ignore groups of objects: which layers a camera draws, which layers collide, which layers a raycast hits. Layers come back in T08 · 3D Physics: Rigidbodies, Colliders, Raycasts & Character Controllers.
- Static. A promise that the object never moves while the game runs, so Unity can precompute things like baked lighting and batching for it.
Active, and active in the hierarchy#
Deactivating a parent deactivates all its children, even though each child's own checkbox stays ticked. Unity tracks the two separately: active self is the object's own checkbox, and active in hierarchy is whether it's really running, which is only true when it and every parent are active. When you reactivate the parent, the children go back to the state their own checkboxes say. You'll meet the same two ideas in code as activeSelf and activeInHierarchy.
Tags and layers#
Unity comes with a few tags (Untagged, Respawn, Finish, EditorOnly, MainCamera, Player, GameController). Two of them do something special:
- MainCamera is how Unity finds "the" camera when code asks for
Camera.main. - EditorOnly objects, and their children, are removed when you build the game. Use it for notes, helpers and test objects that should never ship.
Add your own with Tag > Add Tag…, which opens the Tags and Layers settings. A tag can't be renamed once it's created, so choose names you'll keep. Layers are added in the same place. Some low layers are built in (Default, TransparentFX, Ignore Raycast, Water, UI), and the rest are yours.
Static flags#
The Static checkbox is really a set of flags, one per system that can precompute data for objects that don't move: baked global illumination (Contribute GI), occlusion culling (Occluder and Occludee Static), static batching (Batching Static) and baked reflection probes. Ticking the box turns them all on; the dropdown beside it lets you pick. Only tick what a system needs. Marking every object static wastes bake time and memory, and an object marked static that you then move at runtime won't behave correctly in those systems.
The Transform#
Every GameObject has exactly one Transform, and you can't remove it. It stores three things:
- Position: where the object is, as X, Y and Z.
- Rotation: which way it faces, shown as angles in degrees around X, Y and Z.
- Scale: how big it is along each axis, where 1 is its original size.
It also stores the object's parent. That's why dragging one object onto another in the Hierarchy is a Transform operation: you're changing whose space the object lives in.
Units and axes#
One Unity unit is one metre, by convention. Nothing forces it, but physics assumes it (gravity is 9.81 units per second per second), and assets from the Asset Store and other tools are made that way. Build at real scale: a door about 2 units tall, a person about 1.8. A level built ten times too big makes everything fall in slow motion.
Unity is Y-up and left-handed: X points right, Y points up, and Z points forward, into the screen. The axes are always coloured the same way, everywhere in the Editor: X is red, Y is green, Z is blue (think RGB = XYZ). "Forward" for a character or camera means its blue Z axis, which matters later when you move things with code.
Local and world space#
The values in the Inspector are measured relative to the parent. If an object has no parent, its parent is the world, and its values are world values. If it has a parent, the Inspector shows its local position, rotation and scale: how far it is from its parent, in the parent's own directions.
This is what makes hierarchies so useful. Build a ship once, with a mast, sails and a flag as children, and you can move, turn and copy the whole ship by moving the parent. The children keep their places on the ship.
Parenting#
- Make a child: drag one GameObject onto another in the Hierarchy. The child keeps its world position: Unity recalculates its local values so it doesn't jump.
- Unparent: drag it out to the empty area at the bottom, or between two root objects.
- Group under a new parent: select one or more objects, right-click, and choose Create Empty Parent (Ctrl+Shift+G).
- New empty child: Alt+Shift+N creates one under the selection.
- Paste as Child (Ctrl+Shift+V) pastes a copied object under the selected one, keeping its world position.
- Set as Default Parent (right-click menu): new objects and objects you drag into the scene go under it. Its name shows in bold. Handy when you're placing fifty rocks.
Pivots: where an object turns#
An object rotates and scales around its pivot, which is the point its position refers to. For primitives the pivot is the centre. For imported models it's wherever the artist put it, often at the feet. When the pivot is in the wrong place (a door that spins around its middle instead of its hinge), the fix is an empty parent: put an empty at the hinge, make the door its child, and rotate the empty. You'll do exactly this in the guided build.
Rotation and scale, with care#
The Inspector shows rotation as three angles (called Euler angles), because people understand them. Internally, Unity stores rotation as a quaternion, which avoids some problems angles have. That's why typing 370 into a rotation field can come back as 10, and why the three numbers sometimes change in surprising ways when you rotate with the tool. It's the same rotation, described differently. T06 · Game Maths: Vectors, Trigonometry, Matrices, Quaternions & Interpolation explains quaternions properly.
Scale has three rules worth keeping:
- Keep scale uniform where you can (the same number on all three axes). A parent with non-uniform scale, such as
(1, 4, 1), stretches and skews any rotated child, and sphere and capsule colliders can't stretch into ovals. - Never set a scale axis to 0. It makes some maths impossible, and Unity can produce rendering glitches or errors.
- Fix a model's size when you import it rather than by scaling the object, using the model's Scale Factor import setting. Then every copy is the right size from the start.
Click the link icon next to Scale (Constrained Proportions) to make the three values change together.
Placing things precisely#
The transform tools#
| Key | Tool | What the handle does |
|---|---|---|
| Q | View | Left-drag pans the view; nothing gets moved by accident |
| W | Move | Drag an arrow to move along one axis, a coloured square to move in a plane, the centre to move freely |
| E | Rotate | Drag a coloured ring to rotate around that axis; the outer ring rotates around the view direction |
| R | Scale | Drag an axis to stretch along it, the centre cube to scale evenly |
| T | Rect | Move, resize and rotate as a flat rectangle. Made for 2D and UI, but works on 3D objects too |
| Y | Transform | Move, rotate and (with Local handles) scale in one combined handle |
The axis you drag turns yellow. Hold Shift while dragging the Move tool's centre to slide the object along a plane facing the camera.
The Tool Settings overlay has two toggles that change where and how the handle sits:
- Pivot / Center (Z): put the handle at the object's pivot, or at the centre of everything selected.
- Local / Global (X): line the handle up with the object's own axes, or with the world's. To push a tilted plank along its own length, use Local. To move it straight up, use Global.
Typing numbers, and maths in fields#
For exact placement, type into the Transform fields. You can also drag left and right on a field's label (the "X") to scrub the value. Numeric fields accept maths: type 2.5*4 and you get 10. With several objects selected they accept special functions too:
L(0,20)spreads the values evenly from 0 to 20, so ten selected fence posts end up evenly spaced.R(-5,5)gives each object a random value between −5 and 5, for natural-looking rocks and trees.+=2,-=2,*=2,/=2change every selected value at once.
Combine them to lay objects out in a circle: with several objects selected, set X to cos(L(0,2*pi))*6 and Z to sin(L(0,2*pi))*6. They're spread around a circle of radius 6. (The first and last object land on the same spot, because 0 and 2π are the same angle; use one more object than you need and delete it, or stop just short of 2*pi.)
Snapping#
- Increment snapping: hold Ctrl (macOS: Cmd) while you move, rotate or scale, and the value changes in fixed steps. Set the step sizes from the arrow next to the grid snap button in the Grid and Snap overlay.
- Grid snapping: turn on the grid snap button in the Grid and Snap overlay and moved objects land on grid points. It works with Global handles only. Push to Grid (Ctrl+\) snaps the selection onto the nearest grid points.
- Vertex snapping: with the Move tool, hold V, hover over a corner of the selected mesh, then drag: that corner snaps to corners of other meshes. It's the way to butt two road pieces or walls together exactly.
- Surface snapping: hold Shift+Ctrl (macOS: Shift+Cmd) and drag the Move handle's centre: the object slides over the surfaces of other objects that have colliders. With the Rotate tool, the same keys turn the object to face a point you hover over.
When you drag a prefab or model from the Project window into the Scene view, it lands where the mouse ray hits something, which is often all the snapping you need.
Other placement commands#
- Duplicate: Ctrl+D copies the selection in place. Then move the copy.
- Move To View (Ctrl+Alt+F): moves the selection to the centre of the Scene view.
- Align With View (Ctrl+Shift+F): moves and turns the selection to match the Scene Camera. Used for cameras and lights.
- Reset the Transform from its ⋮ menu to put it back at the parent's origin, unrotated, at scale 1.
Components and the Inspector#
Select a GameObject and the Inspector lists its components from top to bottom, Transform first. Each component has a header (its icon, an enable checkbox if it has one, its name, a ? help button and a ⋮ menu) and its properties below.
Adding components#
Click Add Component at the bottom of the Inspector and start typing: "rigid" finds Rigidbody, "audio" finds Audio Source. The same list is in the Component menu, sorted by category. You can also drag a script from the Project window onto a GameObject in the Hierarchy or onto the Inspector.
A GameObject can have any number of components, but some only make sense together. A Rigidbody (physics) needs a Collider to hit anything; a Mesh Renderer needs a Mesh Filter to know which mesh to draw. Some components require another and add it for you, and Unity warns you if you try to remove a component that another one depends on.
Components you'll see everywhere#
| Component | What it does | Chapter |
|---|---|---|
| Transform | Position, rotation, scale and parent. Always there | this one, T06 · Game Maths: Vectors, Trigonometry, Matrices, Quaternions & Interpolation |
| Mesh Filter | Holds which mesh (the 3D shape) to use | T33 · Rendering in Unity 6: URP & HDRP, Cameras, PBR Materials & Post-Processing |
| Mesh Renderer | Draws that mesh with one or more materials, and casts and receives shadows | T33 · Rendering in Unity 6: URP & HDRP, Cameras, PBR Materials & Post-Processing |
| Box / Sphere / Capsule / Mesh Collider | Gives the object a shape for collisions and clicks | T08 · 3D Physics: Rigidbodies, Colliders, Raycasts & Character Controllers |
| Rigidbody | Lets physics move the object: gravity, forces, bouncing | T08 · 3D Physics: Rigidbodies, Colliders, Raycasts & Character Controllers |
| Camera | Renders the scene from this object's point of view | T07 · Input System, Movement & Cameras (Cinemachine) |
| Light | Lights the scene: Directional, Point, Spot or Area | T57 · Lighting & Global Illumination: Baked, Mixed & Realtime, Adaptive Probe Volumes, Reflection Probes & Lighting Art |
| Audio Source | Plays sound from this object's position | T21 · Audio: Mixers, Sound Design, Adaptive Music, FMOD & Wwise |
| Your scripts | Anything you write in C# | T05 · Scripting in Unity: Lifecycle, Serialization, Coroutines & Awaitable |
Editing values#
A component's properties are either values (numbers, text, colours, checkboxes, dropdowns) or references to something else (a mesh, a material, another GameObject, a sound). To set a reference, drag the asset or GameObject onto the field, or click the small circle (⊙) at its right to pick from a list. A reference field that says None is empty. One that says Missing points to something that has been deleted.
The ⋮ menu (or right-click on the header) has the commands you need to manage components:
- Reset: put the component back to its default values.
- Remove Component.
- Move Up / Move Down: reorder. You can also drag headers. Order matters to the reader more than to Unity, so keep the important components near the top.
- Copy Component, then Paste Component Values onto a component of the same type, or Paste Component As New onto another GameObject.
- Properties…: opens a small Inspector window locked to just that component.
The enable checkbox switches one component off without removing it, so you can test the scene without a light, without a script, or without a collider. Only components that do something every frame or can be switched on and off have it.
Editing several objects at once#
Select several GameObjects (Ctrl-click or Shift-click in the Hierarchy) and the Inspector shows the components they have in common. A field where their values differ shows a dash (—). Typing a value sets it on all of them, which is where the L() and R() functions above come in.
Inspector tools#
- Lock (the padlock in the Inspector's top right): the Inspector stops following your selection. Lock it on a light, then click around the scene while you tweak it. Forgetting it's locked is a classic "the Inspector is broken" moment.
- Properties (Alt+P, or right-click > Properties): opens a floating Inspector for just the selected object. You can have several.
- Debug mode (Inspector ⋮ menu > Debug): shows the raw data, including private values that the normal view hides. Useful when a script misbehaves. Switch back with Exit Debug.
- Presets (the slider icon in a component header): save a component's settings as an asset and apply them elsewhere, or make a preset the default for new components of that type. Good for things like "the way we set up a point light".
Materials, lights and the camera, briefly#
Three things make a scene look like anything at all. They each get a full chapter later, but you need the basics to build anything now.
Materials#
A material is an asset that says how a surface looks: its colour, how shiny or metallic it is, which textures it uses. The Mesh Renderer refers to it. Create one with Assets > Create > Material, or from the Project window's + menu. In a URP project it uses the Universal Render Pipeline/Lit shader. Set Base Map's colour swatch to pick a colour, and use Metallic and Smoothness to make it look like metal, plastic or stone. Then drag the material onto an object in the Scene view or the Hierarchy.
A material is shared: every object that uses Stone.mat changes when you edit it. That's what you want for a whole wall of stone, and a surprise when you meant to make one rock darker. Duplicate the material (Ctrl+D in the Project window) for a variation.
Lights#
- Directional: light from infinitely far away, in one direction, like the sun. Only its rotation matters.
- Point: light shining in all directions from a point, fading with distance, like a bulb.
- Spot: a cone of light, like a torch or a lighthouse beam.
- Area: light from a rectangle or disc. Only used for baked lighting.
Lighting settings for the whole scene (the skybox, ambient light, baking) are in Window > Rendering > Lighting, and they're saved per scene. Post-processing effects such as bloom and colour grading come from a Volume, which is what the template's Global Volume is. T57 · Lighting & Global Illumination: Baked, Mixed & Realtime, Adaptive Probe Volumes, Reflection Probes & Lighting Art covers lighting and baking, and T33 · Rendering in Unity 6: URP & HDRP, Cameras, PBR Materials & Post-Processing covers Volumes and post-processing.
The camera#
The Camera component's most important settings are its Field of View (how wide it sees, in degrees; 60 is the default), its Clipping Planes (nothing nearer than Near or further than Far is drawn), and its Projection (Perspective or Orthographic, the same idea as in the Scene view). Click the camera in the Hierarchy and a small preview of what it sees appears in the corner of the Scene view.
Assets and the Project window#
The Project window shows your Assets/ folder and the read-only packages in Packages/. Its ⋮ menu switches between a one-column tree and the more common two-column layout with folders on the left and contents on the right. The slider at the bottom changes the icon size; drag it all the way left for a list.
Getting assets in#
Drag files from Explorer or Finder into the Project window, or copy them into the Assets folder on disk. Unity notices, imports them into its own formats (the results go in Library/), and creates a .meta file for each. Select an imported asset to see its import settings in the Inspector, such as a texture's maximum size or a model's scale, and click Apply after changing them.
Organising a project#
Unity doesn't care how you arrange folders, but people do. A layout that scales from a jam game to a large project:
Assets/
├── _Project/ ← everything you made, in one place
│ ├── Art/
│ │ ├── Materials/
│ │ ├── Models/
│ │ └── Textures/
│ ├── Audio/
│ ├── Prefabs/
│ ├── Scenes/
│ └── Scripts/
├── Settings/ ← render pipeline assets from the template
└── ThirdParty/ ← Asset Store packs, kept separateThe underscore sorts _Project to the top. Keeping your own files apart from imported packs means you can update or delete a pack without hunting through your folders. Some teams prefer folders by feature (Player/, Enemies/, Shop/, each with its own art, prefabs and scripts) instead of by type. Both work; mixing them doesn't.
Finding things#
- The Project window's search box searches names. Add
t:to filter by type andl:by label:t:Material stone,t:Prefab,t:Scene. - Labels are tags for assets: select an asset, then use the label button at the bottom of the Inspector's preview.
l:Placeholderthen finds every placeholder you meant to replace. - Favorites, at the top of the folder tree, hold folders and saved searches you use often.
- Unity Search (Ctrl+K) searches assets, scene objects, menu items and settings from one box. Typing "lighting" finds the Lighting window; "t:Light" finds every light in the scene.
- The Hierarchy has its own search box, which filters the scene the same way.
- Right-click an asset > Show in Explorer (Reveal in Finder on macOS) to see it on disk.
Scenes#
A scene is an asset like any other, saved as a .unity file. Small games often have a menu scene and one scene per level. Larger ones load several scenes at once (more on that below).
Creating, opening and saving#
- New scene: File > New Scene (Ctrl+N) opens the New Scene dialog, where you pick a scene template: Basic gives you a camera and a light, Empty gives you nothing. Right-click in the Project window > Create > Scene makes one from the Basic template without the dialog.
- Open: double-click the scene asset. If the current scene has unsaved changes, Unity asks first.
- Save: Ctrl+S. An asterisk after the scene's name in the Hierarchy means unsaved changes.
Which scenes are in the game#
A build only contains the scenes in the scene list. Open File > Build Profiles and look at the Scene List: drag scenes in from the Project window, untick ones you want to keep out, and drag to reorder. The first scene in the list is the one that loads when the game starts. Scenes not in the list can't be loaded by name from code, which is a common cause of "Scene couldn't be loaded" errors.
Several scenes at once#
Drag a second scene from the Project window into the Hierarchy (or right-click it > Open Scene Additive) and both are open together, each with its own header in the Hierarchy. Uses:
- Split a level for a team: lighting in one scene, gameplay objects in another, so two people don't edit the same file.
- Keep shared things in one place: a "Systems" scene with managers and UI, always loaded alongside the level.
- Stream a big world in pieces at runtime (T10 · Your First Complete Game Loop: States, Scenes, UI, Audio & Builds).
One scene is the active scene (its name is bold): objects you create go into it, and its lighting settings are the ones used. Change it from the scene header's ⋮ menu > Set Active Scene. The same menu lets you Unload a scene (keep it listed but closed) or Remove it.
Scene templates#
If every level should start with the same camera rig, lighting and managers, save a scene as a template (right-click the scene > Create > Scene Template From Scene, or from the File menu). It then appears in the New Scene dialog. A template can clone some of its assets (each new scene gets its own copy of, say, its lighting settings) and reference others (all scenes share the same materials).
Prefabs#
A prefab is a GameObject, with all its components and children, saved as an asset. Placing it in a scene makes an instance: a copy that stays linked to the asset. Change the prefab asset and every instance in every scene updates.
Use prefabs for anything that appears more than once (trees, enemies, pickups, doors, a lamp post) and for anything code creates while the game runs (bullets, effects, enemies from a spawner). Even a one-off object is often worth making a prefab, because a prefab is its own file: two people can edit two prefabs at the same time without touching the same scene file, which matters a lot under Git (T01).
Making and placing prefabs#
- Build the object in the scene: a parent with its children and components.
- Drag it from the Hierarchy into a folder in the Project window. It becomes a prefab asset, and the object in the scene becomes its first instance. Its icon in the Hierarchy turns blue.
- Drag the prefab from the Project window into the scene (or the Hierarchy) to place more instances.
Instances of the same prefab can sit at different positions and rotations; that's expected, so the root's position and rotation never count as changes to the prefab.
Editing a prefab: Prefab Mode#
To change the prefab itself, open it in Prefab Mode. A breadcrumb bar at the top of the Scene view shows you're inside a prefab, and the Hierarchy shows only its contents. There are two ways in:
- In isolation: double-click the prefab asset in the Project window. The rest of the scene disappears, so you see the prefab on its own.
- In context: select an instance in the scene and press P, click Open in its Inspector, or click the small arrow next to it in the Hierarchy. The scene stays visible around it (greyed out by default; the Context option in the bar switches between Normal, Gray and Hidden) so you can fit the prefab to its surroundings. You can't change the root's Transform values in this mode.
Changes are saved automatically while Auto Save (top right of the Scene view) is ticked. Leave Prefab Mode with the back arrow in the Hierarchy or the breadcrumbs.
Overrides: changing one instance#
You can also change an instance directly in the scene: give one cottage a red door, move one tree's branch, add a light to one lamp post. Each change is an override, and the instance keeps every other link to its prefab. Overrides show up as:
- a blue bar to the left of the changed property or component in the Inspector, and the property name in bold;
- a plus badge on added components and child objects, and a minus badge on removed ones;
- a blue bar beside the instance in the Hierarchy when anything inside it is overridden.
The Overrides dropdown at the top of the instance's Inspector lists every override. From it you can:
- Apply All: push the instance's changes into the prefab asset, so every instance gets them.
- Revert All: throw the changes away and match the prefab again.
- Click single overrides to apply or revert just those. You can also right-click any overridden property > Apply or Revert.
An overridden value always wins. If you later change that property on the prefab asset, the instances that override it don't change. That's the rule behind most "I changed the prefab and some of them didn't update" puzzles: check the instance for a blue bar.
Nested prefabs#
A prefab can contain instances of other prefabs. The cottage prefab contains a chimney prefab; the chimney prefab is still its own asset, so improving it improves every chimney on every cottage (and on anything else that uses it). Build bigger prefabs out of smaller ones the same way a building is made of doors and windows. Add a nested prefab by dragging one into a prefab in Prefab Mode, or onto an instance in the scene and then applying the added object.
Prefab variants#
A variant is a prefab based on another prefab. It inherits everything from its base and stores only what it changes. Right-click a prefab > Create > Prefab Variant, or drag an instance with overrides into the Project window and choose Prefab Variant in the dialog that appears. Variant icons are blue cubes with one grey side.
Variants are the clean way to make families: an Enemy base, with Enemy_Fast and Enemy_Armoured variants. Fix a bug in the base and every variant gets the fix, while each variant keeps its own speed or armour. A variant can be based on another variant, but keep chains short (two levels is plenty) or it becomes hard to tell where a value comes from.
Unpacking, replacing and missing prefabs#
- Unpack (right-click an instance > Prefab > Unpack) turns the instance back into ordinary GameObjects with no link to the asset. Nested prefabs inside it stay as instances; Unpack Completely breaks those links too. Do this when one copy should go its own way for good.
- Replace (right-click > Prefab > Replace, or drag a prefab onto the instance's Prefab field in the Inspector) swaps an instance to a different prefab and can keep its overrides. Unity matches parts by name, so give children unique names.
- An instance whose prefab asset has been deleted shows in red in the Hierarchy as a missing prefab. Restore the asset from version control, or unpack the instance to keep what's there.
Play mode#
Press Play (Ctrl+P) and the game runs inside the Editor, in the Game view. Pause (Ctrl+Shift+P) freezes it so you can look around in the Scene view and inspect values; Step (Ctrl+Alt+P) advances one frame at a time. Press Play again to stop.
While playing, the Scene view and Inspector still work. You can move things, change values and watch the effect immediately, which is how most tuning is done.
What you keep and what you lose#
When you stop, the scene goes back to how it was when you pressed Play. That protects you from saving a scene in the middle of a test, but it also throws away every tweak you made while playing. The rule is about where the change lives:
| Thrown away when you stop | Kept |
|---|---|
| Changes to GameObjects and components in the scene: positions, values on components, objects added or deleted | Changes to assets: editing a material, a prefab asset in Prefab Mode, a ScriptableObject, import settings |
| Anything your scripts did to the scene | Changes made outside the scene: Project Settings, Preferences, layouts, files on disk |
That second column surprises people. Change the colour of a material while playing and it stays changed, because the material is a file. It's useful (you can tune a material live) and dangerous (a script that changes a shared material's colour at runtime changes the asset too). T33 · Rendering in Unity 6: URP & HDRP, Cameras, PBR Materials & Post-Processing covers how code avoids that.
The Game view#
The Game view's bar at the top controls how the game is shown while you test:
- Aspect: Free Aspect follows the window size. Pick a fixed ratio such as 16:9, or a resolution, to see what players will see, and add your own with the + at the bottom of the list.
- Scale: zoom into the image to check details.
- Play Focused / Play Maximized / Play Unfocused: whether pressing Play focuses or maximises this Game view.
- Mute Audio, Stats (frame rate and rendering numbers), and Gizmos (show the Scene view's helper drawings in the Game view too).
- The Game / Simulator switch: the Simulator view shows the game inside the screen of a chosen phone or tablet, including the notch and safe area (T47 · Mobile: Touch Input, Builds, Optimisation & Store Publishing).
How fast Play mode starts depends on the Enter Play Mode settings in Project Settings, covered in T01. T05 · Scripting in Unity: Lifecycle, Serialization, Coroutines & Awaitable explains what they mean for your scripts.
Working faster#
Selecting, hiding and locking#
- Click selects; Ctrl-click adds or removes; drag a box in the Scene view to select everything inside it.
- Clicking the same spot again in the Scene view cycles through overlapping objects. To pick from a list instead, hold Ctrl (macOS: Cmd) and right-click: the selection piercing menu lists everything under the cursor.
- Scene visibility: the eye icon beside a GameObject in the Hierarchy (or H) hides it in the Scene view only. The game still has it. Use it to get the roof out of the way while you furnish a house.
- Scene picking: the hand icon (or L) makes an object unclickable in the Scene view, so you stop grabbing the floor when you meant to grab the chair.
- Alt-click the arrow beside a parent in the Hierarchy to expand or collapse everything under it.
Undo#
Ctrl+Z undoes and Ctrl+Y redoes (macOS: Cmd+Z and Cmd+Shift+Z). Edit > Undo History (also on the toolbar) lists every step, so you can jump back several at once. Undo covers what you do in the Editor; it doesn't cover changes your scripts make while playing, or files changed outside Unity. Git is your real safety net.
Shortcuts#
Edit > Shortcuts (macOS: Unity > Shortcuts) shows a keyboard map with every command and its binding. Search for a command to find its shortcut, or click a key on the map to see what it does. You can rebind anything, and save your bindings as a profile. When a shortcut in this handbook doesn't work for you, look it up here: a package or a previous change may have rebound it.
The new Hierarchy (preview)#
Guided build: Lighthouse Island#
You'll build a small island at dusk: a lighthouse whose lamp sweeps around, a few cottages, a ring of trees, a jetty and a boat that rocks on the water. Everything is made from primitives, so you need no art. On the way you'll use every part of this chapter: navigation, parenting and pivots, snapping, materials, prefabs, nesting, variants, overrides, Play mode and the scene list.
Allow about two hours. Save often (Ctrl+S), and commit to Git at the end of each step if you set it up in T01.
Step 1 · A scene and some folders#
- In the Project window, create the folders from Organising a project:
_ProjectwithMaterials,Prefabs,ScenesandScriptsinside it. - Right-click
_Project/Scenes> Create > Scene, name itIsland, and double-click it to open it. It starts with a camera and a light. - Create five empty GameObjects at the root, named
Environment,Buildings,Props,LightingandGameplay. Check each one is at(0, 0, 0). Drag the Directional Light intoLightingand the Main Camera intoGameplay.
These empties are folders. Every object you add from now on goes inside one of them, so the Hierarchy stays readable when the scene has two hundred objects in it.
Step 2 · Sea and island#
- Make four materials in
_Project/Materials(Assets > Create > Material) and set their Base Map colours:Seadeep blue (smoothness 0.8),Sandpale yellow,Grassmuted green,Rockgrey. - Create a Plane named
SeainsideEnvironment. Position(0, 0, 0), scale(12, 1, 12): a plane is 10 × 10 units, so this is 120 m across. Drag the Sea material onto it. - Create a Cylinder named
BeachinsideEnvironment, position(0, 0, 0), scale(34, 0.3, 34), with the Sand material. A cylinder is 2 tall, so its top is 0.3 above the sea. - Duplicate it (Ctrl+D), rename the copy
Meadow, scale(28, 0.5, 28), Grass material. Its top is at 0.5. - Select
Sea,BeachandMeadowand tick Static in the Inspector header. They'll never move.
Fly around it (right mouse + W A S D). Press F on Meadow and orbit. Check the island from below with the Orientation overlay: the plane vanishes, because planes only render from above.
Step 3 · The lighthouse, built from parts#
Build the lighthouse under an empty parent so that the whole thing moves as one, with its pivot on the ground.
- Create an empty named
LighthouseinsideBuildingsat(9, 0.5, 7): on top of the meadow, away from the middle. - Add these children to it (create each, then drag it onto
Lighthouse, then type its local values). Make materialsWhite,RedandLampas you go.
| Child | Primitive | Local position | Scale | Material |
|---|---|---|---|---|
Tower | Cylinder | (0, 5, 0) | (2.4, 5, 2.4) | White |
StripeLow | Cylinder | (0, 3.5, 0) | (2.45, 0.6, 2.45) | Red |
StripeHigh | Cylinder | (0, 7.5, 0) | (2.45, 0.6, 2.45) | Red |
Gallery | Cylinder | (0, 10.15, 0) | (3.4, 0.15, 3.4) | Rock |
LampRoom | Cylinder | (0, 11.1, 0) | (1.6, 0.8, 1.6) | Lamp |
Roof | Sphere | (0, 12.1, 0) | (1.9, 1.2, 1.9) | Red |
The tower is a cylinder scaled to 5 on Y, so it's 10 m tall, and its centre is 5 above the parent, so its base sits exactly on the parent's pivot. Check that by selecting Lighthouse: the Move handle should be at the foot of the tower.
For the Lamp material, tick Emission and set its colour to a warm yellow, so the lamp room glows even in shadow.
- Now the part that turns. Create an empty child of
LighthousenamedLampPivotat local(0, 11.1, 0). Give it two children:Head: a Cube at local(0, 0, 0.9), scale(0.5, 0.4, 0.3), Lamp material. It pokes out of the lamp room and shows which way the lamp faces.Beam: GameObject > Light > Spot Light, dragged ontoLampPivot, at local(0, 0, 1.1)with rotation(25, 0, 0). A spot light shines along its Z axis, and the 25° tilts it down. Set Range to 60 and Spot Angle to 25, a warm colour, and raise Intensity until you can see its pool of light on the island and the sea.
- Select
Beamand Ctrl+D. Set the copy's rotation to(25, 180, 0)and position to(0, 0, -1.1): a second beam pointing the other way, like a real two-sided lamp.
- Drag
Lighthousefrom the Hierarchy into_Project/Prefabs. It turns blue: it's now a prefab and this object is its first instance.
Step 4 · Two scripts that bring it to life#
Create two scripts in _Project/Scripts with Assets > Create > Scripting > MonoBehaviour Script, named exactly Spin and Bob. Open each, replace everything in it with the code below, and save. You don't need to understand the code yet; for now, notice that each [SerializeField] line becomes a setting you can change in the Inspector.
using UnityEngine;
namespace Handbook.T02
{
// Turns the GameObject at a steady speed. Used for the lighthouse lamp.
public class Spin : MonoBehaviour
{
[SerializeField] Vector3 axis = Vector3.up;
[SerializeField] float degreesPerSecond = 45f;
[SerializeField] Space space = Space.Self;
void Update()
{
// Time.deltaTime is the length of the last frame, so the speed is the same at any frame rate.
transform.Rotate(axis, degreesPerSecond * Time.deltaTime, space);
}
}
}using UnityEngine;
namespace Handbook.T02
{
// Moves the GameObject gently up and down around where it started, and rocks it, like a boat on water.
public class Bob : MonoBehaviour
{
[SerializeField, Min(0f)] float height = 0.15f;
[SerializeField, Min(0f)] float wavesPerSecond = 0.4f;
[SerializeField, Range(0f, 20f)] float rockDegrees = 4f;
Vector3 startPosition;
Quaternion startRotation;
float offset;
void Start()
{
startPosition = transform.localPosition;
startRotation = transform.localRotation;
offset = Random.value * Mathf.PI * 2f; // so two boats don't move in step
}
void Update()
{
float wave = Mathf.Sin(Time.time * wavesPerSecond * Mathf.PI * 2f + offset);
transform.localPosition = startPosition + Vector3.up * (wave * height);
transform.localRotation = startRotation * Quaternion.Euler(0f, 0f, wave * rockDegrees);
}
}
}The namespace Handbook.T02 line keeps these scripts from clashing with anything else called Spin; you can keep it. If Unity shows an error in the Console, check that the file names match the class names exactly (Spin.cs contains class Spin).
- Double-click the Lighthouse prefab to open it in Prefab Mode (in isolation). Select
LampPivotand dragSpinonto its Inspector. Leave the defaults: around its own up axis at 45° a second. Leave Prefab Mode with the back arrow. Every lighthouse you'll ever place now has a spinning lamp. - Press Play. The beams sweep the island. While playing, change Degrees Per Second on
LampPivotto 90 and watch it speed up. Stop. The value is back to 45, because that change was made on the scene instance during Play mode.
Step 5 · A cottage with a working door and a nested chimney#
First the chimney, as its own prefab, because cottages and other buildings will share it.
- Create an empty named
Chimneyanywhere. Children:Stack, a Cube at local(0, 0, 0)scale(0.6, 1.4, 0.6)with the Rock material, andCap, a Cube at local(0, 0.75, 0)scale(0.75, 0.12, 0.75). DragChimneyintoPrefabs, then delete it from the scene. - Create an empty named
CottageinsideBuildingsat(-3, 0.5, 1). Make materialsWalls(cream),Roof(dark red) andWood(brown). Add children:
| Child | Primitive | Local position | Rotation | Scale |
|---|---|---|---|---|
Walls | Cube | (0, 1.25, 0) | (0, 0, 0) | (4, 2.5, 5) |
RoofLeft | Cube | (-1.05, 3.2, 0) | (0, 0, 35) | (2.6, 0.15, 5.4) |
RoofRight | Cube | (1.05, 3.2, 0) | (0, 0, -35) | (2.6, 0.15, 5.4) |
Look at the roof from the front with the Orientation overlay's Z arm and orthographic projection: the two panels lean together into a ridge. Each panel rotates around its own centre, which is why both need a position as well as an angle.
- The door, with a hinge. A cube rotates around its centre, but a door must swing on its edge. So create an empty child of
CottagenamedDoorHingeat local(-0.5, 0, 2.52): the bottom left corner of where the door goes, just in front of the wall. Give it a childDoor, a Cube at local(0.5, 1, 0)scale(1, 2, 0.08)with the Wood material. - Select
DoorHinge, press E, and drag the green ring. The door swings on its hinge. Set its Y rotation back to 0. - Drag the
Chimneyprefab ontoCottagein the Hierarchy so it becomes a child, at local(1.2, 3.6, -1.4). It pokes up through the right-hand roof panel. - Drag
CottageintoPrefabs. Unity asks nothing, because only the chimney inside was already a prefab: the chimney stays a nested prefab inside the new Cottage prefab.
Step 6 · A variant, and overrides#
- Right-click the Cottage prefab > Create > Prefab Variant, and name it
Cottage_Fisher. Open it in Prefab Mode. - Make a
RoofBluematerial and drag it onto both roof panels. Add a childBarrel(Cylinder, local(2.5, 0.5, 2), scale(0.7, 0.5, 0.7), Wood). These are the variant's overrides: look at the Inspector's blue bars and the plus badge onBarrel. Leave Prefab Mode. - Place two Cottage_Fisher instances on the jetty side of the island, at about
(-4, 0.5, -11)and(4, 0.5, -11), and one more plain Cottage at(3, 0.5, 2). Turn them as you like: rotate around Y with Ctrl held so it snaps in steps. - Now test inheritance. Open the base Cottage prefab and change the Walls material colour, or swap
Wallsto a new material. Every cottage changes, variants included, because variants inherit what they don't override. The roofs of the fisher cottages stay blue, because that's overridden. - Finally, an instance override. Select one plain cottage in the scene and rotate its
DoorHingeto Y = -100, so its door stands open. Look at the Inspector: the rotation is in bold with a blue bar. Open the Overrides dropdown on the cottage to see it listed. Don't apply it. This one cottage has an open door; the prefab doesn't.
Step 7 · A ring of trees, placed with maths#
- Build a
Treeprefab: an empty root, aTrunk(Cylinder, local(0, 1, 0), scale(0.3, 1, 0.3), Wood) and aCrown(Sphere, local(0, 2.6, 0), scale(1.8, 1.8, 1.8), a dark green material). Pivot on the ground again. - Drag one Tree into
Environment, then duplicate it until you have 13 trees. Select all 13. - In the Transform, type
cos(L(0,2*pi))*8into Position X,sin(L(0,2*pi))*8into Position Z, and0.5into Y. They form a circle of radius 8 around the centre, between the middle cottages and the outer buildings. The first and last tree land in the same spot (0 and 2π are the same angle), so delete one of those two. - With the 12 still selected, type
R(0,360)into Rotation Y andR(0.8,1.4)into Scale Y. Each tree gets a random turn and height, so the ring doesn't look stamped out. - If a tree stands in a building, move it by hand or delete it. Mark the trees Static.
Step 8 · A jetty with vertex snapping, and a boat#
- Inside
Props, create an emptyJettyat the island's edge, about(0, 0.3, -16). Add aPlankchild: a Cube, scale(2, 0.12, 1), Wood. - Duplicate the plank. With the copy selected and the Move tool active, hold V, hover over one of its corners, and drag it to the matching corner of the first plank. It clicks into place exactly edge to edge. Repeat until the jetty is six planks long, heading out to sea.
- Add a few posts (Cylinders scaled
(0.2, 0.6, 0.2)) under the edges, using surface snapping (Shift+Ctrl while dragging) to stand them on the sea. - Make a boat beside the jetty: an empty
Boatat sea level, aHull(Cube, local(0, 0.2, 0), scale(1.4, 0.4, 3.2)), aMast(Cylinder, local(0, 1.4, 0.3), scale(0.08, 1, 0.08)), and aSail(Cube, local(0, 1.5, -0.1), scale(0.04, 1.6, 1), white). This is the boat-and-mast hierarchy from the diagram above. - Add the
Bobcomponent toBoat(not to the hull: you want the whole boat to rock). Duplicate the boat once and move the copy. Press Play: both boats rock, out of step with each other.
Step 9 · Dusk, and the shot#
- Select the Directional Light. Set its rotation to
(10, -40, 0): a low sun. Give it a warm orange colour and lower its intensity a little. The sky changes with it. - Inside one cottage, add a Point Light with a warm colour and a short range, placed just inside a wall, so the cottage glows. Apply it to the prefab if you want every cottage lit, or keep it as an override on this one.
- Fly the Scene view to a view you like: low, across the jetty, with the lighthouse behind. Select the Main Camera and press Ctrl+Shift+F (Align With View).
- In the Game view, set the aspect to 16:9. Press Play and watch for a while: lamp sweeping, boats rocking, warm windows.
Step 10 · Tidy, save, and add it to the build#
- Check every object is inside one of the five group objects. Collapse them all (Alt-click the arrows).
- Make sure the moving things aren't static:
LampPivotand both boats must have Static unticked. (A static object that moves is a bug waiting to happen.) - Save. Open File > Build Profiles and drag
Islandinto the Scene List. Untick or remove the template'sSampleScene, or dragIslandto the top so it loads first. - Commit:
git add .andgit commit -m "Lighthouse Island". Look atgit statusfirst: you should see your scene, prefabs, materials and scripts, each with a.metafile.
Going further#
A one-click scene structure#
If every scene should start with the same group objects, a few lines of editor code can add them for you. This tool adds a Handbook > T02 > Add Scene Groups menu item. It skips groups that already exist and supports undo. Put it in a folder named Editor (any folder called Editor is editor-only and never goes into a build). T17 · Editor Scripting & Custom Tools (IMGUI and UI Toolkit) teaches editor scripting properly.
using UnityEditor;
using UnityEngine;
namespace Handbook.T02.EditorTools
{
// Adds the same top-level group objects to a scene, so every scene is organised the same way.
public static class SceneGroups
{
static readonly string[] Groups = { "Environment", "Buildings", "Props", "Lighting", "Gameplay" };
[MenuItem("Handbook/T02/Add Scene Groups")]
static void AddGroups()
{
int added = 0;
foreach (string groupName in Groups)
{
// A leading "/" only finds objects at the root of the Hierarchy.
if (GameObject.Find("/" + groupName) != null)
{
continue;
}
var group = new GameObject(groupName);
Undo.RegisterCreatedObjectUndo(group, "Add Scene Groups");
added++;
}
Debug.Log($"Scene groups: added {added}, {Groups.Length - added} already there.");
}
}
}A scene template (above) does the same job without code. The tool is better when scenes already exist and you want to bring them in line.
Presets as team defaults#
In Project Settings > Preset Manager you can make a preset the default for a component type, optionally filtered by name. Every new Point Light then starts with your team's range and colour, and every imported texture whose name ends in _N gets normal-map settings. It's one of the cheapest ways to keep a project consistent.
How teams use prefabs#
- Small prefabs, nested. A level built from a few hundred small prefabs (a wall section, a window, a lamp) is easier to change than one built from huge ones, and two people rarely edit the same file.
- Scenes hold placement, prefabs hold content. If a scene has big trees of unique, unprefabbed objects, every change to them is a change to the scene file, and scene files are where merge conflicts hurt most.
- Variants for families, overrides for one-offs. If you find yourself making the same override on many instances, that's a variant waiting to be made.
- Watch the override count. Instances with dozens of overrides drift away from their prefab until nobody knows which values are real. The Overrides dropdown and Revert All are your clean-up tools.
Grey-boxing#
What you did in the guided build has a name: grey-boxing (or blocking out), building a level from simple shapes to test layout and scale before any art exists. Studios do it for every level. ProBuilder, a free Unity package, takes it much further, letting you model rooms, ramps and stairs directly in the Scene view. T29 · Level Design: Grey-Boxing, ProBuilder, Flow & Worldbuilding covers both.
Overlay and layout presets#
Overlays and layouts can both be saved. From the Overlays menu (`) choose Save Preset to keep an arrangement of Scene view tools for level building, another for lighting, and switch between them as you work.
Common mistakes & debugging#
"I can't see my object"#
- It's hidden in the Scene view. Check the eye icon in the Hierarchy, and that scene visibility is on in View Options.
- It's inactive, or one of its parents is. Faded names in the Hierarchy give it away.
- It's far away or tiny. Select it in the Hierarchy and press F. Check its scale isn't 0 and its parent's scale isn't tiny.
- You're looking at the back of a plane or quad. They only render from one side.
- Its layer is hidden in the Scene view's View Options, or culled by the camera's Culling Mask in the Game view.
- It's behind the camera, or outside its clipping planes (Game view only). Check Near and Far on the camera.
"I can't select it, or I keep selecting the wrong thing"#
- Its pickability is off (the hand icon), or you keep grabbing something big in front of it. Turn off picking on the floor or the walls while you work.
- Use the selection piercing menu (Ctrl + right-click) or click the object in the Hierarchy.
- You're in Prefab Mode in context, where the rest of the scene is locked. Use the breadcrumbs to go back.
"My changes disappeared"#
- You made them in Play mode. Use a Playmode tint, and Copy Component / Paste Component Values to carry values out.
- You didn't save the scene, and opened another one or closed Unity. Look for the asterisk.
- You changed an instance and then clicked Revert, or changed the prefab and the instance overrides that property (so your prefab change is hidden on that instance).
"It looks wrong"#
- Magenta: the material's shader doesn't work in URP. Use the Render Pipeline Converter or switch it to URP/Lit.
- Stretched or skewed children: a parent has non-uniform scale and the child is rotated. Scale the child (or the mesh) instead of the parent.
- Everything changed colour, not just one object: you edited a shared material. Duplicate it for the one object.
- The handle isn't where you expect: check Pivot / Center and Local / Global in Tool Settings.
- The rotation numbers changed by themselves: Unity re-expressed the same rotation with different angles. It's the same rotation.
"The Editor is acting strangely"#
- The Inspector won't change when I select things: it's locked (padlock).
- A window has vanished: Window > General, or Window > Layouts > Default to reset.
- I can't orbit: the Orientation overlay's padlock is on, or you're in 2D mode (View Options).
- I can't add my script: the Console has a compile error, or the file name doesn't match the class name. Fix the first red error in the Console and the rest often go away.
- A shortcut does nothing: the mouse is over a different window (most Scene shortcuts only work over the Scene view), or it has been rebound. Check Edit > Shortcuts.
Exercises#
1 · The flying test
In an empty scene, place six small spheres: one on top of a tall cylinder, one under a plane, one inside a closed box made of six cubes, one 200 m away, one behind a wall, and one at (0, 0, 0). Then, starting each time from a view of the whole scene, get a close look at each sphere as fast as you can, without using the Hierarchy. Time yourself, then do it again tomorrow.
Solution
The fastest route to each one combines a few moves: click (or Ctrl + right-click to pierce), F to frame, Alt-drag to orbit. The sphere in the box needs either a hidden wall (H on a cube), wireframe draw mode, or flythrough mode to fly inside. The one under the plane needs orbiting below it (the plane disappears from beneath). The far one is quickest with the Hierarchy and F in real work, which is exactly why you shouldn't use it here: the point is to make the camera controls automatic. Under 10 seconds per sphere is good.
2 · Which window?
For each task, name the window you'd use: (a) change a light's colour; (b) find every material in the project; (c) make the cottage a child of the island; (d) read why your script didn't compile; (e) see what the player will see; (f) change a texture's import size.
Solution
(a) Inspector, with the light selected. (b) Project window, searching t:Material (or Unity Search). (c) Hierarchy, dragging the cottage onto the island. (d) Console. (e) Game view. (f) Inspector, with the texture asset selected in the Project window, then Apply.
3 · Predict the world position
Work these out on paper, then check them in Unity by building them and reading the child's position after unparenting it (unparenting keeps the world position).
- Parent at
(2, 0, 0), no rotation, scale 1. Child at local(1, 1, 0). - Parent at
(2, 0, 0), no rotation, scale 2. Child at local(1, 1, 0). - Parent at
(2, 0, 0), rotation(0, 90, 0), scale 1. Child at local(1, 0, 0).
Solution
(3, 1, 0): just add the offsets.(4, 2, 0): the parent's scale stretches the child's offset too, so the offset becomes(2, 2, 0).(2, 0, -1). Turning 90° around Y (clockwise, seen from above) swings the parent's X axis round to point along world −Z, so one unit along the parent's X is one unit toward −Z. If you guessed(2, 0, 1), you turned the wrong way: in Unity, a positive Y rotation turns forward (+Z) toward right (+X), and right toward back (−Z). T06 · Game Maths: Vectors, Trigonometry, Matrices, Quaternions & Interpolation makes this precise.
4 · A treasure chest lid
Build a chest from cubes: a box and a lid. Make the lid open by rotating one object around the back edge of the box, so it swings up and back like a real lid. Then make it a prefab and place three, one open and two closed, without changing the prefab.
Solution
Add an empty LidHinge at the top back edge of the box (for a box centred on its pivot at local (0, 0.5, 0) with scale (1.2, 1, 0.8), that's local (0, 1, -0.4)). Make the lid a child of the hinge, positioned so its back edge sits on the hinge: local (0, 0.05, 0.4), scale (1.2, 0.1, 0.8). Rotate the hinge around X: −70° opens it. Make the chest a prefab; on one instance rotate its LidHinge. That's an instance override (bold, blue bar) and the prefab stays closed.
5 · The override detective
A teammate set Range to 8 on the Point Light inside the Cottage prefab. Four cottages in the scene got the new range, but two still have the old one. What happened, how do you confirm it, and how do you fix it without losing anything else on those two cottages?
Solution
Those two instances override the light's Range, so the prefab's value doesn't reach them. Confirm it by selecting each one: the light's Range is bold with a blue bar, and it appears in the cottage's Overrides dropdown. Fix it by right-clicking the Range property > Revert, which reverts only that property and keeps the cottage's other overrides. Don't use Revert All unless you've checked the list.
6 · A family of trees
From the guided build's Tree prefab, make two variants: Tree_Pine, whose crown is a tall capsule instead of a sphere, and Tree_Dead, which has no crown at all. Then change the base tree's trunk colour and check which trees change.
Solution
Tree_Pine: in the variant, disable or remove the sphere crown and add a Capsule child at the same height, scaled (1.2, 1.8, 1.2); or keep the crown object and swap its Mesh Filter's mesh to the capsule (one override instead of two). Tree_Dead: delete the crown in the variant; the Hierarchy shows it as a removed object override. Changing the base trunk colour changes all three, because neither variant overrides the trunk. That's the point of variants: shared parts stay shared.
7 · Stairs from one formula
Make a staircase of 12 steps, each 0.2 m high and 0.3 m deep, going up toward +Z, using one Cube and the Inspector's numeric functions. No step should be placed by hand.
Solution
Make one step (scale (1.2, 0.2, 0.3)), duplicate it to 12, select all 12, and type L(0.1,2.3) into Position Y and L(0,3.3) into Position Z. L spreads values evenly from the first to the last, so with 12 objects the step between them is (2.3 − 0.1) ÷ 11 = 0.2 in Y and 3.3 ÷ 11 = 0.3 in Z. The first step's centre is at 0.1 so it sits on the floor. If your steps come out in the wrong order, the selection order differs from the Hierarchy order; select them top to bottom in the Hierarchy.
8 · Split the island into two scenes
Split Lighthouse Island into Island_World (sea, beach, meadow, trees, buildings, lighting) and Island_Gameplay (camera, boats, and anything a player would interact with). Make them open together, make sure the lighting looks the same as before, and set up the scene list so both are in the build. Write two sentences on why a team might want this split.
Solution
Create the two scenes, open both (drag the second into the Hierarchy), and drag objects between the scene headers to move them. Lighting settings (sky, ambient, baking) are saved per scene and the active scene's are used, so make Island_World the active scene, or copy its Lighting settings to the other. Add both scenes to the scene list; at runtime the gameplay scene would be loaded additively by code (T10 · Your First Complete Game Loop: States, Scenes, UI, Audio & Builds). Why: an artist can light and dress Island_World while a designer tunes Island_Gameplay, and they never edit the same file, so there's nothing to merge.
Check yourself#
What is a GameObject with only a Transform?
- An error: every GameObject needs a Mesh Renderer
- An invisible collider
- An empty container with a position, useful as a folder, pivot or marker
- A prefab
Components give a GameObject its abilities. With only a Transform it has a place in the world and can have children, which is exactly what empties are for.
A parent is inactive. Its child's own active checkbox is ticked. Is the child running?
- Yes, because its own checkbox is ticked
- No: it's only active in the hierarchy when it and all its parents are active
- Only its scripts run
- Only in Play mode
activeSelf is the checkbox; activeInHierarchy is whether it really runs. Reactivate the parent and the child comes back on.
During Play mode you change the colour of a material in the Project window. What happens when you stop?
- The colour goes back
- Unity asks whether to keep it
- The material is deleted
- The new colour stays, because the material is an asset
Play mode only resets the scene. Assets such as materials, prefab assets and ScriptableObjects keep their changes.
An instance overrides a prefab's Speed value. You then change Speed on the prefab asset. What does the instance do?
- Keeps its overridden value
- Takes the new value
- Averages the two
- Becomes unpacked
An override always wins over the asset. Revert the override to make the instance follow the prefab again.
A child is at local position (0, 3, 0). Its parent is at (5, 0, 0) with no rotation and scale 1. Where is the child in the world?
(0, 3, 0)(5, 0, 0)(5, 3, 0)(5, 3, 5)
With no rotation or scale on the parent, world = parent position + local offset.
Which tag makes Unity remove a GameObject and its children from builds?
UntaggedEditorOnlyFinishGameController
EditorOnly objects exist in the Editor and are stripped when the game builds. Good for notes and helpers.
An object you imported shows up bright magenta. What's the most likely cause?
- It has no texture
- Its light is too bright
- It's selected
- Its material uses a shader the current render pipeline can't run
Magenta is Unity's "shader not supported" colour. Convert the material to URP.
Where do you choose which scenes are included when you build the game in Unity 6?
- The Scene List in File > Build Profiles
- The Hierarchy
- Project Settings > Player
- Every scene in the project is always included
Only scenes in the scene list are built, and the first one loads first. Older versions called this window Build Settings.
A door rotates around its middle instead of its edge. What's the usual fix?
- Scale it to 0 on one side
- Use the Rect tool
- Put an empty at the hinge, make the door its child, and rotate the empty
- Turn on Pivot mode
Objects rotate around their pivot. An empty parent gives you a pivot wherever you need one.
What does a prefab variant store?
- A full copy of its base prefab
- A link to its base prefab plus only the changes it makes
- Only its position in the scene
- Nothing until you unpack it
A variant inherits everything else from its base, so fixes to the base reach the variant automatically.
Cheat sheet#
Scene view
- Right mouse + WASD QE: fly (scroll = speed)
- Alt + left-drag: orbit
- Middle-drag: pan · scroll: zoom
- F: frame · Shift+F: follow
- `: Overlays menu
- Shift+Space: maximise window
Tools
- Q view · W move · E rotate
- R scale · T rect · Y transform
- Z pivot/center · X local/global
- Ctrl-drag: increment snap
- V-drag: vertex snap
- Shift+Ctrl-drag: surface snap
Hierarchy and objects
- Ctrl+Shift+N: new empty
- Alt+Shift+N: new empty child
- Ctrl+Shift+G: empty parent
- Ctrl+D: duplicate · F2: rename
- H: hide · L: unpickable
- Ctrl+Shift+F: align with view
Play and save
- Ctrl+P: play / stop
- Ctrl+Shift+P: pause
- Ctrl+Alt+P: step a frame
- Ctrl+S: save scene
- Ctrl+K: search everything
- Scene changes in Play mode are lost; asset changes are kept
Prefabs
- Blue cube: prefab instance
- Blue cube, grey side: variant
- Blue bar / bold: override
- Red name: missing prefab
- Double-click asset: edit in isolation
- P on instance: edit in context
Rules of thumb
- 1 unit = 1 m; Y up; RGB = XYZ
- Empty parents at (0,0,0), scale 1
- Keep scale uniform; never 0
- Move assets inside Unity only
- Read the Overrides list before Apply All
- Number fields take
L(),R(), maths
Courses that cover this#
Glossary#
- Scene
- An asset (
.unityfile) holding a set of GameObjects: a level, a menu, a test room. - GameObject
- Anything in a scene. A container with a name and a Transform, given abilities by its components.
- Component
- A piece of functionality attached to a GameObject, such as a Mesh Renderer, Collider, Light or your own script.
- Composition
- Building objects by combining components rather than by inheriting from a type for each kind of object.
- Transform
- The component every GameObject has: position, rotation, scale and parent.
- Hierarchy
- The window listing the GameObjects in open scenes as a tree of parents and children.
- Inspector
- The window showing and editing the components and settings of the selected item.
- Overlay
- A floating, movable toolbar or panel inside the Scene view, such as Tools or Grid and Snap.
- Primitive
- A built-in shape: Cube, Sphere, Capsule, Cylinder, Plane or Quad.
- Empty
- A GameObject with only a Transform, used as a folder, pivot or marker.
- Pivot
- The point an object's position refers to, and which it rotates and scales around.
- Local space
- Positions and directions measured relative to a parent. What the Inspector shows for a child.
- World space
- Positions and directions measured from the scene's origin and axes.
- Tag
- One word attached to a GameObject so code can recognise it. Each GameObject has exactly one.
- Layer
- One of 32 groups that cameras, physics and raycasts can include or ignore.
- Static
- Flags saying a GameObject never moves at runtime, so systems like lighting and batching can precompute data for it.
- Material
- An asset describing how a surface looks: shader, colours, textures. Shared by every object that uses it.
- Prefab
- A GameObject saved as an asset, so it can be placed many times and changed in one place.
- Prefab instance
- A copy of a prefab in a scene, linked to the asset.
- Override
- A change on a prefab instance (or variant) that differs from its prefab, shown with a blue bar.
- Nested prefab
- A prefab instance inside another prefab, keeping its link to its own asset.
- Prefab variant
- A prefab based on another prefab, storing only its differences.
- Prefab Mode
- The editing mode for a prefab asset, opened in isolation or in context.
- Play mode
- Running the game inside the Editor. Scene changes made during it are undone when it stops.
- Active scene
- With several scenes open, the one new objects go into and whose lighting settings are used.
- Build profile
- A saved set of build settings for a platform, including the list of scenes to build.