Setting Up Unity

From installation to navigation

· 5 min read
  • Human Computer Interaction
  • Unity

This guide is based on Unity 6.5. Menu names and shortcuts may differ slightly in other versions.

Unity is one of the most widely used engines for building 3D games and interactive environments. In this guide, I go over how to install it, create your first project, and find your way around the editor.

Installation & Setup

Unity Hub & Editor

We first need to download Unity Hub. This is the launcher that manages Editor versions, modules and projects. Once it’s installed, create a Unity account, sign in and activate a license (personal or student).

Next, install a version of the Unity Editor from the Installs tab. Long Term Support (LTS) versions are the safest choice, since they get bug fixes for longer. During installation, the Hub also lets you pick extra modules:

  • Build Support: Lets you export your project to other platforms like Android and iOS. You can skip these for now and add them later.
  • Documentation: An offline copy of the Unity manual. Handy, but optional.

Try to use the same Editor version for a specific project. Opening a project in a different version may break or change things.

Code Editor

Unity scripts are written in C#, so you also need a code editor. I recommend Visual Studio Code with Microsoft’s Unity extension, which also installs the C# Dev Kit. For code completion and error checking to work, you need the .NET SDK installed as well.

Once it’s installed, set it as Unity’s default script editor under External Tools > External Script Editor. On macOS, this is in Unity > Settings, and on Windows it’s in Edit > Preferences. Double-clicking a script in Unity will then open it in your editor.

Create Your First Project

  1. Open Unity Hub, go to the Projects tab and click New project.
  2. Pick a template. For 3D work, choose Universal 3D, which uses the Universal Render Pipeline (URP). URP runs well on most hardware, from laptops to phones.
  3. Set a project name and a location on your disk.
  4. Optionally, choose GitHub as the version control provider and sign in with a Personal Access Token (PAT). The Hub then creates a repository for the project and adds a .gitignore for you.
  5. Click Create project. The first launch takes a few minutes while Unity imports packages and generates project files.

Project Structure

A Unity project is a regular folder on disk. These are the parts that matter:

MyProject/
├── Assets/           # Everything you create: scenes, scripts, models, materials
├── Packages/         # The list of packages the project uses
├── ProjectSettings/  # Project-wide settings
└── Library/          # Cache generated by Unity

The Library folder can be deleted at any time, since Unity rebuilds it from the other folders. It also gets very large, so it should never be committed to version control. The .gitignore from Unity Hub already excludes it, but if you set up Git yourself, you can start from this template.

Always move, rename and delete assets from within Unity since it tracks assets through .meta files. Changing files through file explorer can break the references between them.

The Unity Interface

Once the editor opens, you will see a collection of panels:

  • Scene View: The canvas where you place and arrange objects in 3D space.
  • Game View: Renders what the player sees through the active camera.
  • Hierarchy: Lists every game object in the open scene. Objects can be nested under each other to form parent-child relationships.
  • Inspector: Shows and edits the properties and components of the selected object.
  • Project Window: A file browser for all the project’s assets, such as models, scripts and materials.
  • Console: Shows debug messages, warnings and compilation errors.
Unity's user interface
Unity's user interface

Every panel can be dragged, docked or resized. If the layout ever gets messy, you can switch to a preset or reset it under Window > Layouts.

GameObjects & Components

Everything in a scene is a GameObject: a camera, a light, a cube or an empty container. A GameObject does nothing on its own. Its behavior comes from components attached to it, which you can see in the Inspector. Every GameObject has a Transform component that stores its position, rotation and scale. A cube also has a Mesh Renderer to draw it and a Box Collider for physics. Adding a feature to an object usually means adding another component to it.

To move around the Scene View, a mouse or trackpad is required:

  • Orbit: Hold Alt (Option on Mac) and left-click drag.
  • Pan: Drag with the middle mouse button. On a Mac trackpad, hold Option + Command and click-drag.
  • Zoom: Use the scroll wheel, or swipe with two fingers on a trackpad.
  • Focus: Select an object in the Hierarchy, hover over the Scene View and press F to center on it. Shift + F locks the view to the object, so the camera follows it when it moves.
  • Flythrough Mode: Hold the right mouse button and move with W, A, S, D, with Q and E to move down and up. Hold Shift to move faster.

To manipulate objects directly in the Scene View, switch between tools using these hotkeys:

  • View (Q): Pan the view by dragging.
  • Move (W): Move along the X (red), Y (green) and Z (blue) axes.
  • Rotate (E): Rotate around each axis.
  • Scale (R): Scale along one axis, or uniformly from the center handle.
  • Rect (T): Resize using a 2D rectangle, mostly used for UI and sprites.
  • Transform (Y): Move, rotate and scale with a single combined handle.

Portrait of Atta Ul Haleem
About me Hi, I'm Atta. I write about my experiments with technology, coding, and everything in between.
→
← Back to Blog