Skip to content
Tutorials Center
My learning

Topics

Lesson 3 of 36 ยท Getting Started

Your First Scene

Build your first Unity scene: add a floor, a cube and a light, move and rotate objects with the gizmos, save the scene, press Play, and make the cube fall with physics.

In this lesson you build a tiny scene from nothing: a ground, a cube that falls onto it, and a camera that looks at both. You will learn the exact clicks, the shortcut keys, and what each step does behind the scenes. After one scene you will understand the daily rhythm of Unity: add objects, move them, add components, press Play.

Everything here is done in the editor, so the steps are written for your own computer. Code examples are read-only Unity scripts, and the runnable blocks use plain C# to demonstrate the math the editor performs.

Step 1: start from a clean scene

Create a new scene with File > New Scene, choose the Basic (Built-in) or Standard URP template that matches your project, and save it with File > Save As as Assets/Scenes/Playground.unity. A new scene contains a Main Camera and a Directional Light. The Hierarchy window lists both.

Save early with Ctrl+S (Cmd+S on macOS). The title bar shows an asterisk when a scene has unsaved changes.

Step 2: add a ground

Right-click an empty area in the Hierarchy and choose 3D Object > Plane. Rename it Ground by selecting it and pressing F2 (or slowly clicking the name). A plane is a flat 10 x 10 unit square. In the Inspector, set the Scale to 3, 1, 3 so it becomes bigger.

Now the Transform component at the top of the Inspector shows Position 0,0,0, Rotation 0,0,0 and Scale 3,1,3. Every GameObject has a Transform; you cannot remove it.

Step 3: add a cube

Add 3D Object > Cube and rename it Crate. It appears at the origin, half inside the ground. Move it up by setting Position Y to 4. You can also use the Move tool (W key): drag the colored arrows in the Scene view. The tools are:

Key Tool What it changes
Q Hand Pans the view only
W Move Position
E Rotate Rotation
R Scale Scale
T Rect 2D/UI size and position
Y Transform Move, rotate and scale in one gizmo

Hold the right mouse button in the Scene view and use W, A, S, D to fly around. Press F with an object selected to frame it, which is the fastest way to find something.

Step 4: give the cube a color

In the Project window right-click inside Assets, choose Create > Material, name it RedMat, and set its Base Map color (URP) or Albedo color (Built-in) to red. Drag the material onto the cube in the Scene view. A material describes how a surface looks; the cube's MeshRenderer component draws the mesh using that material.

Step 5: make it fall

Select the cube and click Add Component in the Inspector, then choose Physics > Rigidbody. Press Play. The cube falls and lands on the plane without sinking in, because both objects already have a collider (planes and cubes come with one) and the Rigidbody makes the cube move under gravity.

Stop Play Mode. The cube returns to Y = 4, because Play Mode never changes the scene file.

What happened under the hood

When you press Play, every physics step Unity does something like this for the Rigidbody:

  1. adds gravity to the velocity (y velocity decreases by 9.81 per second),
  2. moves the position by velocity times the step time,
  3. checks for overlap with other colliders and pushes the objects apart if they intersect.

You can imitate step 1 and 2 in a few lines. Physics runs at a fixed rate of 50 steps per second by default (Fixed Timestep 0.02 s), so this stand-in uses dt = 0.02.

C# A falling cube, stand-in

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with Console.ReadLine()), it gets the next line from this box.

The cube accelerates until it reaches the ground, then rests. Unity does the same thing but also handles bounce, friction and rotation.

Step 6: your first script, read-only

You do not need a script for the falling cube, but here is a small one that you will build properly in the next chapters. It resets the cube to a start position when you press the R key (this uses the Input System's legacy Input class, which we cover in the UI and Input chapter):

C#
using UnityEngine;

public class ResetOnKey : MonoBehaviour
{
    Vector3 startPosition;

    void Start()
    {
        startPosition = transform.position;
    }

    void Update()
    {
        if (Input.GetKeyDown(KeyCode.R))
        {
            transform.position = startPosition;
            GetComponent<Rigidbody>().linearVelocity = Vector3.zero;
        }
    }
}

To use it: create a C# script in the Project window, paste the code, drag it onto the cube, and press Play. The class name must match the file name (ResetOnKey.cs), or Unity will refuse to attach it.

Step 7: a few more things to try

  • Add several more cubes at different heights; they stack and topple because each has a Rigidbody and a collider.
  • Select the Directional Light and rotate it; shadows move.
  • Select the Main Camera and look at the Camera preview in the corner of the Scene view. Use GameObject > Align With View (Ctrl+Shift+F) to snap the camera to your current view.
  • Add 3D Object > Sphere and give it a Rigidbody; compare how it rolls compared with the cube.

Understanding the Game view

The Scene view is your workshop camera. The Game view shows exactly what the player will see, through the Main Camera. If something is visible in Scene but not in Game, it is outside the camera's view or behind its near clip plane. The aspect ratio drop-down at the top of the Game view lets you test phone and widescreen shapes.

Here is a slide overview of the whole first-scene workflow:

Build a scene

New scene Camera and light included
Ground 3D Object, Plane
Crate 3D Object, Cube

Rename everything. Clear names save time later.

1 / 2

Common mistakes

  • Editing during Play Mode and losing the work. The editor tint is your warning.
  • Forgetting to save the scene. Moves in the Hierarchy are only stored in the file when you save.
  • Scaling with a Rigidbody in a script instead of the Inspector. Prefer changing the scale in the editor.
  • No collider: if the cube falls through the floor, check that both have a collider component.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which key activates the Move tool?

    Q is Hand, W is Move, E is Rotate, R is Scale.
  2. 2. What does a Rigidbody component do?

    With a Rigidbody the physics engine applies gravity and collisions to the GameObject.
  3. 3. You press Play, move a cube in the Scene view, and press Play again to stop. Where is the cube?

    Changes made in Play Mode are discarded when Play Mode ends.
  4. 4. What is the default fixed timestep of the physics system?

    0.02 s means 50 physics updates per second.

Summary

  • A scene starts with a camera and a light; add objects through the Hierarchy menu.
  • Use W, E, R to move, rotate and scale; F frames the selected object.
  • Materials control looks; Rigidbody plus collider gives physics.
  • Play Mode shows the Game view and discards changes when stopped.
  • Physics steps at a fixed rate, 50 Hz by default.

Next: The Game Loop: How Unity Runs Your Game