Installing Unity & Project Setup
Download Unity Hub, install the right Unity version, set up your code editor, and create the project that will become our infinite runner.
Step 1: Download and Install Unity Hub
Unity Hub is a small application that manages your Unity installations and projects. Think of it as a launcher — you don't open Unity directly; you open Unity Hub, and it opens the correct Unity version for your project. This is important because you might eventually have multiple Unity versions installed for different projects.
- Open your web browser and go to https://unity.com/download.
- Click the "Download Unity Hub" button. The website will automatically detect your operating system (Windows, macOS, or Linux) and give you the correct installer.
- Run the downloaded installer:
- Windows: Double-click the
.exefile. Click "I Agree" on the license agreement, then "Install." It will install toC:\Program Files\Unity Hubby default. - macOS: Open the
.dmgfile and drag Unity Hub to your Applications folder. - Linux: Follow the AppImage or .deb instructions on the download page.
- Windows: Double-click the
- Launch Unity Hub once the installation is complete.
- You'll be asked to sign in or create a Unity account. This is required (even for the free tier). Click "Create account" if you don't have one, or sign in with your existing credentials.
- After signing in, Unity Hub will ask you to activate a license. Choose "Get a free personal license." The Personal license is completely free and lets you use Unity with no restrictions as long as your revenue or funding is under $100K/year. For learning, this is exactly what you need.
Unity Hub does three things: (1) it lets you install and manage multiple Unity editor versions side by side, (2) it stores your list of projects so you can open any of them with one click, and (3) it handles license activation. You'll always start here when working with Unity. If you ever can't find your project, open Unity Hub and it will be listed under the "Projects" tab.
Step 2: Install the Right Unity Version
Unity releases new versions frequently. There are three types of releases:
- LTS (Long-Term Support) — These are the most stable. Unity guarantees bug fixes and security patches for two years. This is what we want.
- Tech Stream — These have the latest features but may have more bugs. Good for experimentation, not for projects you want to finish.
- Alpha/Beta — Pre-release versions. Never use these for real projects.
For this course, we recommend Unity 6 LTS (also known as Unity 6000.0 LTS). If that's not available yet when you're reading this, use Unity 2022 LTS instead. Both will work perfectly with everything in this tutorial.
- In Unity Hub, click the "Installs" tab in the left sidebar.
- Click the "Install Editor" button in the top-right corner.
- You'll see a list of available Unity versions. Look for the one labeled "LTS" with a green badge. This is the version you want. Click "Install" next to it.
- A dialog will ask which modules to install alongside the editor. Modules add support for building to specific platforms. For now, select:
- Microsoft Visual Studio Community (Windows only) — This is our code editor. If you already have Visual Studio or prefer VS Code, you can skip this.
- WebGL Build Support — Optional but useful if you want to publish your game to the web later.
- Android Build Support — Optional, only if you want to build for Android phones.
- iOS Build Support — Optional, only available on macOS, for building iPhone/iPad games.
- Click "Install" and wait. This download is large (several gigabytes). It may take 15–60 minutes depending on your internet speed. Go get a coffee.
If you're on Windows and don't already have a C# code editor, make sure to install Visual Studio Community when prompted. Unity and Visual Studio are tightly integrated — double-clicking a script in Unity will open it directly in Visual Studio at the right line. You can use VS Code instead (instructions below), but Visual Studio provides the smoothest experience for beginners on Windows.
Step 3: Set Up Your Code Editor
You'll write all your C# code in a code editor, not inside Unity itself. Unity has a tiny built-in text area, but it's not meant for real development. You need a proper editor with syntax highlighting, autocompletion, and error detection.
Option A: Visual Studio (Recommended for Windows)
If you installed Visual Studio Community through Unity Hub in the previous step, you're already set. Visual Studio will be configured automatically to work with Unity. You can verify this by going to Edit → Preferences → External Tools in Unity and checking that "External Script Editor" is set to Visual Studio.
Option B: Visual Studio Code (All Platforms)
VS Code is a lightweight, free code editor by Microsoft that works on Windows, macOS, and Linux. If you prefer it over Visual Studio (or you're on Mac/Linux), follow these steps:
- Download VS Code from https://code.visualstudio.com and install it.
- Open VS Code and install the C# extension:
- Click the Extensions icon in the left sidebar (it looks like four squares).
- Search for "C#" and install the one by Microsoft (called "C# Dev Kit").
- Also install the "Unity" extension by Microsoft for better Unity integration.
- Back in Unity, go to Edit → Preferences → External Tools and set "External Script Editor" to Visual Studio Code.
Windows users: Start with Visual Studio Community. It has the best out-of-the-box Unity support, including debugging, IntelliSense (code autocompletion), and integrated help. Mac/Linux users: Use VS Code with the C# Dev Kit extension. It's lighter and cross-platform. You can always switch later — your code files are just text files that any editor can open.
Step 4: Create a New 3D (URP) Project
Now for the exciting part — creating the actual project that will become our infinite runner.
- In Unity Hub, click the "Projects" tab in the left sidebar.
- Click the "New project" button in the top-right corner.
- You'll see a list of project templates. Look for and select "3D (URP)" or "Universal 3D". It may be labeled slightly differently depending on your Unity version, but it will mention "URP" or "Universal Render Pipeline."
- In the "Project name" field, type:
InfiniteRunner. No spaces — this keeps file paths clean and avoids potential issues on some platforms. - Choose a location for your project. Pick somewhere easy to find, like
C:\Unity Projects\on Windows or~/Unity Projects/on Mac. Avoid paths with special characters or very deep nesting. - Make sure "Connect to Unity Cloud" is unchecked (we don't need cloud services for this tutorial).
- Click "Create project" and wait. Unity will generate the project structure, import default packages, and compile everything. This takes 2–5 minutes on first launch.
Unity offers multiple 3D templates. The "3D" or "3D Core" template uses the older Built-in Render Pipeline, which is legacy. We specifically want 3D (URP) — the Universal Render Pipeline. If you create a project with the wrong pipeline, you'll need to start over or go through a painful conversion process. Double-check before clicking "Create project."
What Is URP and Why Do We Use It?
URP stands for Universal Render Pipeline. A render pipeline is the system that decides how Unity draws everything on screen — how it handles lighting, shadows, post-processing effects, and materials. Unity has three render pipelines:
- Built-in Render Pipeline — The original, legacy pipeline. Still works but hasn't received major updates in years. Not recommended for new projects.
- URP (Universal Render Pipeline) — The modern, versatile pipeline. It's optimized for performance across all platforms (mobile, PC, console, VR). It has a good balance of visual quality and speed. This is what we use.
- HDRP (High Definition Render Pipeline) — Designed for high-end PC and console games with photorealistic graphics. It requires powerful hardware and is overkill for a mobile-style runner.
We choose URP because:
- It runs well on every platform, from low-end phones to gaming PCs.
- It supports modern features like Shader Graph (visual shader editor) and 2D lights.
- It's the recommended pipeline for most new Unity projects.
- Almost all tutorials and asset store packages support URP.
- For an infinite runner that might target mobile, URP's performance optimizations matter.
Technically, you can convert a project from one render pipeline to another, but it requires changing all your materials and shaders. It's a tedious process. That's why we pick URP from the start and stick with it. Starting with the right pipeline saves you hours of work later.
Step 5: First Time Opening Unity
After Unity finishes creating the project, the editor will open. You'll see a lot of panels, buttons, and menus. Don't panic — we'll explore every one of them in detail in the next chapter. For now, here's a quick orientation so you can confirm everything is working:
You should see these main areas:
- A large 3D viewport in the center — This is the Scene View, where you'll design and build your game world.
- A panel on the left with "Main Camera" and "Directional Light" — This is the Hierarchy, listing every object in your scene.
- A panel on the right with properties and numbers — This is the Inspector, showing details about whatever object you have selected.
- A panel at the bottom with folders and files — This is the Project window, showing all files in your project.
If you see all of these, your installation is working correctly. If Unity looks different or a panel is missing, don't worry — you can reset the layout by going to Window → Layouts → Default from the menu bar at the top.
Every new URP project starts with a scene called SampleScene. It contains two objects: a Main Camera (which is the player's eyes) and a Directional Light (which simulates sunlight). This is the blank canvas we'll build our game on.
Step 6: Create Your First Scene and Save It
The default "SampleScene" works, but we want to start clean with our own scene that has a meaningful name. Here's how to create and save a scene:
- First, let's create a folder for our scenes. In the Project window at the bottom, right-click on the "Assets" folder and choose Create → Folder. Name it
Scenes. - Now create a new scene: Go to File → New Scene from the top menu bar.
- A dialog may appear asking which template to use. Choose "Basic (URP)" or simply the default option. Click "Create."
- Save the scene immediately: Go to File → Save As (or press Ctrl+Shift+S on Windows, Cmd+Shift+S on Mac).
- Navigate to the
Assets/Scenesfolder you just created. - Name the scene
GameSceneand click Save.
You should now see GameScene in your Project window under Assets/Scenes/. The scene file has a .unity extension. This is the main scene where our infinite runner will live.
Unity does not auto-save your scene. If Unity crashes (rare but it happens) or you accidentally close without saving, you'll lose any unsaved changes. Get in the habit of pressing Ctrl+S (or Cmd+S) frequently. Do it every time you make a meaningful change. Your future self will thank you.
Step 7: Verify Your Project Structure
Let's take a look at what Unity created for us. In the Project window, you should see this folder structure inside Assets:
Assets/
Scenes/
GameScene.unity ← Our game scene
Settings/ ← URP rendering settings (auto-generated)
URP-HighFidelity.asset
URP-Balanced.asset
URP-Performant.asset
...
The Settings folder was created automatically by the URP template. It contains render pipeline configuration assets that control how Unity renders graphics. We'll rarely touch these directly, but they're important — they're why our project uses URP instead of the built-in pipeline.
In the next chapter (Project Architecture), we'll create a proper folder structure with folders for Scripts, Prefabs, Materials, and more. For now, having just Scenes/ is perfect.
Step 8: Test That Everything Works
Let's do a quick sanity check to confirm Unity is running properly and your code editor is connected.
- In Unity, press the Play button at the top center of the editor (the triangle icon). The Game View will appear showing what the camera sees. Right now that's just a blank sky and ground. Press Play again to stop.
- Now let's test the code editor connection. In the Project window, right-click on the
Assetsfolder and choose Create → C# Script. Name itTestScript. - Double-click the
TestScriptfile. Your code editor (Visual Studio or VS Code) should open automatically with the script file. - You should see this default code:
using UnityEngine;
public class TestScript : MonoBehaviour
{
// Start is called once before the first execution
// of Update after the MonoBehaviour is created
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}
If your code editor opened and you can see this code, everything is connected correctly. Let's add one line to confirm that scripts can actually run in our game. Modify the Start method like this:
void Start()
{
Debug.Log("Hello from Infinite Runner! Unity is working.");
}
Debug.Log() prints a message to Unity's Console panel. It's the game developer's equivalent of print() — you'll use it constantly for debugging.
- Save the script in your code editor (Ctrl+S).
- Switch back to Unity. You'll notice Unity briefly "compiles" — a small spinner appears in the bottom-right corner. This happens every time you save a script. Unity is compiling your C# code.
- Now we need to attach the script to a GameObject. In the Hierarchy, click on "Main Camera" to select it.
- In the Inspector panel on the right, scroll down and click "Add Component."
- Type
TestScriptin the search box and click on it to add it. - Press Play. Look at the Console panel at the bottom of the editor (if you don't see it, go to Window → General → Console).
- You should see the message: "Hello from Infinite Runner! Unity is working."
If you see that message, congratulations — your development environment is fully set up and working. You can now write code, attach it to objects, and run it in the game.
Now that we've confirmed everything works, delete the test script. In the Project window, right-click TestScript and choose Delete. Unity will also automatically remove it from the Main Camera's components. We'll create our real scripts starting in the C# chapter. Always keep your project clean — don't leave test files lying around.
Chapter Summary
Here's what we accomplished in this chapter:
- Installed Unity Hub and activated a free Personal license.
- Installed the Unity 6 LTS (or 2022 LTS) editor with necessary modules.
- Set up Visual Studio or VS Code as our code editor with C# support.
- Created a new 3D (URP) project called
InfiniteRunner. - Learned what URP is and why it's the right choice for our game.
- Created and saved our GameScene in a
Scenesfolder. - Verified that scripts compile and run correctly with a
Debug.Log()test.
Your development environment is ready. In the next chapter, we'll take a thorough tour of the Unity editor so you understand exactly what every panel, button, and menu does before we start building.