Lesson · Junkyard
'F' → Fullscreen
Today Junkyard gets its yard, a floor and three crates. Everything is done in the editor, with no code.
Starting point. Open your Junkyard project from Activity 1.1. If it is missing or broken, download the junkyard/1-1 copy, as How This Course Uses Unity explains.
A sprite is a 2D picture a game can place and move, like Mario or a coin. Unity measures its world in units, not pixels, so every image needs a setting that says how many pixels make one unit. The crate is 26 pixels wide, so 26 pixels per unit makes one crate exactly one unit: easy numbers for everything that follows.
Junkyard's art is pixel art: small pictures where every pixel was placed on purpose. Unity smooths images as it imports them, which blurs pixel art, so two more settings keep it sharp. Filter Mode set to Point draws each pixel as a crisp square, and Compression set to None keeps every color exactly as it was drawn.

Check it: click crate on its own. The Inspector should read Single, 26, Point (no filter) and None.

Dragging a sprite into the Hierarchy (the list of everything in your scene) makes a new GameObject with two components already on it. The Transform holds where the object is, how big, and how it is turned. The Sprite Renderer draws the picture. Click any GameObject and the Inspector lists its components.

Order in Layer decides which picture is drawn on top when two overlap. Lower numbers are drawn first, so they end up behind. The yard goes far back at -10 so nothing you add later ends up behind it.
Click the Game tab above the scene. It shows what the player's camera sees. You should see the junkyard at sunset filling the whole view:

The ground image is a strip of gravel and dirt only 64 pixels wide, about 2.5 units. A Sprite Renderer's Draw Mode decides how it fills the space you give it. Tiled repeats the picture side by side instead of stretching it, so a 25-unit floor is ten copies of one small strip, each pixel still square.

Read a warning before you click past it; this one says exactly what to fix. Tiling needs the image's Mesh Type set to Full Rect, a plain rectangle Unity can repeat.


In the Game view, a gravel floor runs along the bottom edge. The image is 52 pixels tall, so at 26 pixels per unit the floor is exactly 2 units thick:

Every position is two numbers, X and Y. (0, 0), called the origin, is the center of the world. X grows to the right. Y grows upward, the same as on a math graph or in Scratch, but not like most image editors, where Y grows down.
The crate sits in the exact center of the Game view:

In the Scene view, the selected crate shows two arrows. The red arrow points along +X and the green arrow along +Y. (An icon sits on top of the crate: the scene's light is at (0, 0) too.)

The camera shows 5 units above the origin and 5 below. A position is the object's center. The floor is 2 units thick with its center at -5, so its top edge is at -4, and the crate is 1 unit tall, so its center has to be at -3.5 for it to sit on the floor:
The crate now sits on the floor, right of center:

Ctrl+D duplicates the selected GameObject, components and all. Unity names the copy after the original with a number, like Crate (1).
Your Hierarchy lists six objects plus the light:

Press Play (the triangle at the top of the editor). Three crates sit in a small pyramid on the floor, and nothing moves. That is correct: nothing has weight yet. Press Play again to stop.

Record both answers on your worksheet, then put everything back the way it was.
Loading quiz…
Submit one screenshot showing your Hierarchy and Game view with the three crates, and your worksheet.