Unity Hub, Modules & IDEs
Your daily Unity setup has three parts: Unity Hub (installs editors and opens projects), the editor version with its platform modules, and a C# IDE with a debugger that attaches to Unity.
Unity Hub
- Download Unity Hub from unity.com and sign in with a Unity ID. Choose a licence (Unity Personal is free within Unity's revenue and funding limits; check the current terms for your situation).
- Installs > Install Editor: pick a Unity 6 LTS release. LTS (long-term support) versions receive fixes for a long period without new features: use them for anything you plan to ship.
- Select modules in the same dialog, or later with the gear icon next to an install (Add modules):
| Module | Needed for |
|---|---|
| Microsoft Visual Studio Community (Windows) | an IDE, if you don't use Rider |
| Windows / Mac / Linux Build Support (IL2CPP) | IL2CPP desktop builds (the editor's own platform includes Mono) |
| Android Build Support + OpenJDK + Android SDK & NDK Tools | Android builds |
| iOS Build Support | Xcode projects for iOS (build on a Mac) |
| Web Build Support | browser builds |
| Documentation | the offline manual and scripting reference |
- Projects > New project: choose a template (Universal 3D, Universal 2D, HDRP, mobile and VR samples). Templates are downloaded the first time.
Reading version numbers
Unity 6 versions look like 6000.0.47f1: major line 6000, minor 0, patch 47, and a suffix (f = final release, b = beta, a = alpha). A project's version is stored in ProjectSettings/ProjectVersion.txt; the Hub warns when you open a project with a different editor. Upgrading within the same LTS line (patch versions) is usually safe; jumping lines needs a branch, a backup and testing. The model sorts versions the way the Hub compares them:
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
var installed = new List<string> { "6000.0.47f1", "6000.1.2f1", "2022.3.60f1", "6000.0.9f1", "6000.2.0b4", "6000.0.47f2" };
installed.Sort((x, y) => Parse(x).CompareTo(Parse(y)));
foreach (var v in installed)
{
var p = Parse(v);
string kind = p.Kind switch { 'f' => "release", 'b' => "beta", 'a' => "alpha", _ => "?" };
Console.WriteLine(quot;{v,-12} -> {p.Major}.{p.Minor}.{p.Patch} {kind} {p.Build}");
}
string project = "6000.0.9f1", editor = "6000.0.47f1";
var (pv, ev) = (Parse(project), Parse(editor));
string advice = pv.Major != ev.Major || pv.Minor != ev.Minor ? "different line: upgrade on a branch"
: pv.CompareTo(ev) < 0 ? "same line, newer patch: usually safe"
: "same or older editor: Hub will warn";
Console.WriteLine(quot;open {project} project in {editor}: {advice}");
static (int Major, int Minor, int Patch, char Kind, int Build) Parse(string v)
{
var m = Regex.Match(v, @"^(\d+)\.(\d+)\.(\d+)([abf])(\d+)quot;);
return (int.Parse(m.Groups[1].Value), int.Parse(m.Groups[2].Value), int.Parse(m.Groups[3].Value),
m.Groups[4].Value[0], int.Parse(m.Groups[5].Value));
}2022.3.60f1 -> 2022.3.60 release 1
6000.0.9f1 -> 6000.0.9 release 1
6000.0.47f1 -> 6000.0.47 release 1
6000.0.47f2 -> 6000.0.47 release 2
6000.1.2f1 -> 6000.1.2 release 1
6000.2.0b4 -> 6000.2.0 beta 4
open 6000.0.9f1 project in 6000.0.47f1: same line, newer patch: usually safe
Tuples compare element by element, and 'a' < 'b' < 'f', so alphas sort before betas before final releases.
IDEs
| IDE | Setup | Notes |
|---|---|---|
| JetBrains Rider | install Rider; the JetBrains Rider Editor package (com.unity.ide.rider) is included in templates |
deepest Unity integration: knows serialized fields, event functions, performance-critical contexts (highlights expensive calls inside Update), shader support, Unity log and test runner inside the IDE. Free for non-commercial use; paid licence for commercial work (check current terms) |
| Visual Studio (Windows) | install with the Game development with Unity workload; package com.unity.ide.visualstudio |
free Community edition for individuals and small teams (check the licence); solid debugger and Unity analyzers |
| VS Code | the Unity extension from Microsoft (brings C# Dev Kit); package com.unity.ide.visualstudio |
lightweight, debugging supported; fewer Unity-aware refactorings |
Then select it in Unity: Edit > Preferences > External Tools (macOS: Unity > Settings > External Tools) and set External Script Editor. Click Regenerate project files if the IDE shows red errors that Unity doesn't.
Debugging
- Set a breakpoint in the IDE and use its Attach to Unity action (Rider: "Attach to Unity Editor", Visual Studio: "Attach to Unity").
- Unity asks to switch to Debug code optimization (the bug icon in the editor's status bar toggles it). Release mode is faster but can't hit breakpoints reliably.
- Press Play. Execution stops at the breakpoint; inspect variables, step, evaluate expressions.
- To debug a player build, tick Development Build and Script Debugging in the build profile and attach to the running player.
Tip: Logs are not a substitute for breakpoints, but they complement them. Pass a context object (
Debug.Log("no target", this)) so clicking the log selects the object, and use Collapse in the Console for repeating messages.
Test yourself
Which editor version should a project you plan to ship use?
- The newest alpha
- An LTS release
- Any beta
- The oldest installed version
Your breakpoints in Rider are never hit. What is a common cause?
- Breakpoints only work in builds
- Unity's code optimization is set to Release instead of Debug
- Rider can't debug C#
- Breakpoints require IL2CPP
How do you add Android build support to an existing editor install?
- Package Manager
- Unity Hub: Installs, then Add modules
- Asset Store
- Project Settings > Player