Skip to main content

🗂️ Lesson 8.1: Organizing Your Project

A tidy project is a joy to work in; a messy one grinds you to a halt. Before we build and ship, let's set up the simple organization habits that keep projects manageable as they grow.

🎯 Learning Objectives

  • Set up a sensible folder structure in Assets
  • Adopt clear, consistent naming
  • Lean on prefabs and tidy scenes
  • Add light, helpful comments to scripts

Estimated Time: 25 minutes

In This Lesson

Why It Matters

Right now your project is small enough to hold in your head. In a month, with 40 scripts and 100 assets, "where did I put that?" becomes a daily tax. Ten minutes of organization now saves hours later — and it makes your project pleasant to return to.

💡 Organize as you go, not "later." Later never comes. Drop each new asset into the right folder the moment you make it.

A Folder Structure

Everything you make lives under Assets. Group by type with a handful of folders:

graph TD A[Assets] --> S[Scenes] A --> SC[Scripts] A --> P[Prefabs] A --> M[Materials] A --> AU[Audio] A --> AR[Art / Models]

Create folders with right-click ▸ Create ▸ Folder in the Project panel, then drag existing assets into them. Move the collectible into Prefabs, scripts into Scripts, and so on.

⚠️ Move assets inside Unity, not in the file explorer

Always drag/rename assets in Unity's Project panel. Unity tracks links via hidden .meta files; moving files in Windows Explorer can break references. Inside Unity, moves are safe.

Naming Things

DoAvoid
PlayerMovement, CollectibleNewBehaviourScript, Script1
Mat_Floor, Mat_StarNew Material, mat (3)
SFX_Collect, Music_Loopaudio, sound_final_FINAL

Pick a style and stick to it. Descriptive names mean you find things by reading, not hunting. Prefixes like Mat_ and SFX_ group related assets alphabetically.

Light Comments

A comment explains why, so future-you understands past-you. Add them where intent isn't obvious — don't narrate every line:

// Freeze rotation so the capsule can't tip over when it bumps walls
rb.constraints = RigidbodyConstraints.FreezeRotation;

public float speed = 5f;   // tuned for a gentle, beginner-friendly pace

✅ Pro Tip

Good names reduce the need for comments. float jumpForce needs no comment; a surprising number or a non-obvious trick does. Comment the surprises.

Hands-on Exercise

🏋️ Exercise: Tidy up

  1. Create the folders: Scenes, Scripts, Prefabs, Materials, Audio.
  2. Drag every existing asset into its correct folder (inside Unity).
  3. Rename anything vague — no New Material or Script1 left.
  4. Add one clarifying comment to each of your scripts.
✅ Success check

Your Assets folder has clear subfolders, every asset has a descriptive name, and nothing is loose at the top level except the folders themselves.

🎯 Quick Quiz

Question 1: How should you move or rename assets?

Question 2: When should you organize your project?

Summary

🎉 Key Takeaways

  • Group assets into folders (Scenes, Scripts, Prefabs, Materials, Audio).
  • Use clear, consistent names; prefixes like Mat_ group things.
  • Move/rename assets inside Unity to keep references intact.
  • Comment the why, not every line — good names do most of the work.

🚀 What's Next?

Tidy project, finished game — time for the big moment. Lesson 8.2 builds your game into a real file you can run and share.

🎉 Neat and tidy!