Your complete step-by-step walkthrough — follow at your own pace, tick every box
Course: Game On (9GAMZA)Lesson: T1 — L05Time: ~75 minUnity: 2022.3.xOutcomes: G5-1, G5-2, G5-3
TOTAL XP0/ 50 XP
1
What Is Rigidbody 2D?
~10 min • Give your sprites weight and gravity.
+10 XP
▶
Key Terms for This Section
Rigidbody 2D
A Unity component that tells the physics engine to calculate gravity, mass, drag, and velocity for an object.
Gravity
A force that pulls objects downward. In Unity, Gravity Scale 1.0 = Earth normal.
Physics Engine
The system inside Unity that simulates real-world physics — gravity, collisions, bouncing.
Component
A building block you add to a GameObject to give it abilities (like physics, rendering, or scripts).
1.1
Open Unity Hub and open your L04 project (MyFirstGame). You should see your scene with sprites from last lesson.
1.2
Click on your Player sprite in the Hierarchy. Look at the Inspector — you should see the Transform and Sprite Renderer components.
By default, Unity objects are "ghosts". They have no weight, no gravity, no physics. They just sit there like pictures on a wall. We're about to change that!
1.3
With your Player selected, click "Add Component" at the bottom of the Inspector. Type "Rigidbody 2D" and click it to add.
Important: Make sure you choose "Rigidbody 2D" (the 2D version), NOT "Rigidbody" (which is for 3D)!
1.4
Press Play (triangle button, top centre). Watch what happens... your player falls! It drops off the screen because gravity is now pulling it down. Press Stop when you've seen it.
1.5
Look at the Rigidbody 2D component in the Inspector. Find Gravity Scale — it should be 1 (Earth normal). Try these experiments:
Linear Drag — air resistance (0 = none, higher = more)
Angular Drag — resistance to spinning
Constraints — freeze position or rotation on specific axes
What you should see
Player selected in Hierarchy. Inspector shows Rigidbody 2D component with Gravity Scale = 1.
✓
Checkpoint: "I added Rigidbody 2D to my player. When I press Play, it falls due to gravity."
2
Colliders: The Physical Border
~10 min • Create solid surfaces so objects can't pass through each other.
+10 XP
▶
Key Terms for This Section
Collider
An invisible shape around a sprite that defines its physical boundary — what it can bump into.
Box Collider 2D
A rectangular collision shape. Best for floors, crates, and platforms.
Circle Collider 2D
A circular collision shape. Best for balls and round objects.
Capsule Collider 2D
A pill-shaped collider. Industry standard for humanoid characters.
Is Trigger
A checkbox that makes a collider detect overlaps WITHOUT physical collision (used for pickups, zones).
💡
Think of it this way: Rigidbody = makes it FALL. Collider = makes it STOP. You need BOTH for physics to work properly!
2.1
Click on your ground sprite in the Hierarchy. Click "Add Component" → search "Box Collider 2D" → add it.
Why Box? Your ground is a rectangle — Box Collider matches its shape perfectly and is fast for the computer to calculate.
2.2
Now click on your Player sprite. Add a collider:
If your player is round → add Circle Collider 2D
If your player is a character/person → add Capsule Collider 2D
If your player is square/rectangular → add Box Collider 2D
You'll see a green wireframe outline around your sprite in the Scene View. This shows the collider's shape. It should closely match your sprite.
2.3
Press Play. Your player should fall and land on the ground! It no longer falls through because both objects have colliders that create a physical barrier.
2.4
Check the collider in the Inspector. Find the "Is Trigger" checkbox. Make sure it is NOT ticked.
Is Trigger = OFF means the collider is a solid wall. Is Trigger = ON means objects pass through but you can detect the overlap (used for coins, power-ups, etc. — we'll use this later!).
2.5
Add Box Collider 2D to any other platforms or obstacles in your scene. Each solid surface needs its own collider.
What you should see
Player falling and landing on ground. Green wireframe outlines visible in Scene View around colliders. Player sits on top of ground, not falling through.
✓
Checkpoint: "My player falls with gravity and lands on the ground. It doesn't fall through!"
⚠
Troubleshooting:
Player passes through ground? Check BOTH objects have colliders. Check "Is Trigger" is OFF on both.
Player spinning wildly on landing? Select Player → Rigidbody 2D → Constraints → tick Freeze Rotation Z
Ground falls away when I press Play? Your ground has a Rigidbody 2D set to Dynamic! See Section 3.
3
Body Types & The Great Fall Lab
~15 min • Understand Dynamic vs Static and build a physics playground.
+10 XP
▶
Key Terms for This Section
Dynamic
Moved by gravity and collisions. Use for: players, enemies, falling rocks, projectiles.
Static
Does NOT move. Gravity ignored. Use for: floors, walls, ceilings, platforms.
Kinematic
Not affected by physics forces, but CAN be moved by code. Use for: moving platforms, elevators.
⚠
CRITICAL RULE: If your floor has a Dynamic Rigidbody, it will fall into the void when you press Play! Floors must be Static or have NO Rigidbody at all.
3.1
Check your ground. Click on it. Does it have a Rigidbody 2D? If yes, change the Body Type dropdown to "Static". If it doesn't have a Rigidbody, that's fine — objects without Rigidbody are automatically treated as static.
Quick rule: Things that MOVE = Dynamic Rigidbody. Things that DON'T MOVE = Static or no Rigidbody. Your ground stays put, so it should be Static.
3.2
The Great Fall experiment! Right-click in Hierarchy → 2D Object → Sprites → Circle. This creates a white circle sprite. Rename it "Ball".
3.3
Select the Ball. Add: Circle Collider 2D + Rigidbody 2D (Body Type: Dynamic). Move the Ball to a position ABOVE the ground.
3.4
Create a platform: Right-click → 2D Object → Sprites → Square. Scale it wide (X: 3, Y: 0.3). Add Box Collider 2D. Position it between the ball and the ground at an angle using Rotate (E).
3.5
Press Play! The ball should fall, hit the angled platform, and roll/slide off before landing on the ground below.
Add more platforms at different angles to create a pinball-like course
Duplicate the ball (Ctrl+D) and position copies at different heights
Experiment with different Gravity Scale values on each ball
3.6
Try the Freeze Rotation Z constraint: Select your Player → Rigidbody 2D → Constraints → tick Freeze Rotation Z. This prevents your character from spinning when they collide with things (important for player characters!).
✓
Checkpoint: "I understand Dynamic vs Static. I built a physics course with a falling ball."
4
Physics Materials: Bounce & Slide
~15 min • Make objects bouncy, slippery, or sticky.
+10 XP
▶
Key Terms for This Section
Physics Material 2D
An asset that controls how surfaces interact — how bouncy and how slippery they are.
Bounciness
How much an object bounces. 0 = no bounce (thud). 1 = perfect bounce (bounces forever).
Friction
How grippy a surface is. 0 = ice (super slippery). 1 = sandpaper (very grippy).
4.1
In the Project window (bottom), right-click on your Assets folder → Create → 2D → Physics Material 2D. Name it "Bouncy".
4.2
Click on the "Bouncy" material in the Project window. In the Inspector, set:
Friction: 0.3
Bounciness: 0.8
4.3
Select your Ball in the Hierarchy. In the Inspector, find the Circle Collider 2D component. There's a field called "Material" — drag the "Bouncy" material from the Project window into this slot.
4.4
Press Play! The ball should bounce when it hits the ground! It bounces multiple times, getting lower each time (because Bounciness is 0.8, not 1.0).
4.5
Experiment time! Create two more Physics Materials:
"Ice" — Bounciness: 0, Friction: 0 (super slippery, no bounce)
Apply "Ice" to a platform and watch objects slide. Apply "SuperBounce" to a ball and watch it go crazy!
4.6
Challenge: Can you make a ball bounce exactly 3 times before stopping? Adjust the Bounciness value — try 0.5, 0.6, 0.7... find the sweet spot!
What you should see
A ball bouncing on a platform. Physics Material 2D visible in the Project window. The ball's Collider shows the material assigned.
✓
Checkpoint: "I created a Physics Material, applied it to a collider, and my ball bounces!"
💡
Pro tip: You can apply Physics Materials to ANY collider — ground, walls, platforms. An "Ice" floor + a bouncy ball = chaotic fun!
5
Extension Challenges
If time permits • Push your physics skills further.
+10 XP
▶
These are bonus challenges. Only do them if you've finished Sections 1-4.
5.1
Challenge 1: Rube Goldberg Machine. Build a chain reaction: a ball falls onto a seesaw, which launches another ball, which hits a domino stack. Use at least 5 physics objects in a sequence.
5.2
Challenge 2: Pinball Scene. Create a vertical scene with bumpers (circles with high bounciness), flippers (angled rectangles), and a ball that bounces around. Think classic pinball machine!
5.3
Challenge 3: Variable Gravity. Create 3 balls with different Gravity Scale values (0.5, 1, 3). Drop them from the same height. Which lands first? Can you predict?
5.4
Challenge 4: Polygon Collider. Import a complex-shaped sprite. Add a Polygon Collider 2D — watch how it traces the sprite's outline perfectly! Compare performance with a simple Box Collider.
🎮
Research: Look up "2D physics puzzle games" (like Angry Birds or Cut the Rope). How do they use Rigidbody, Colliders, and Physics Materials to create gameplay? Write a short paragraph.