Stats

875 Contributors: 24 Friday, July 21, 2017
Licensed under: CC-BY-SA
Not affiliated with Stack Overflow
Rip Tutorial: riptutorial@gmail.com
Roadmap: roadmap

Getting started with unity3d

Remarks

Unity provides a cross platform game development environment for developers. Developers can use C# language and/or JavaScript syntax based UnityScript for programming the game. Target deployment platforms can be switched easily in the editor. All core game code stays same except some platform dependent features. A list of all the versions and corresponding downloads and release notes can be found here: https://unity3d.com/get-unity/download/archive.

Versions

VersionRelease Date
Unity 2017.1.02017-07-10
5.6.22017-06-21
5.6.12017-05-11
5.6.02017-03-31
5.5.32017-03-31
5.5.22017-02-24
5.5.12017-01-24
5.52016-11-30
5.4.32016-11-17
5.4.22016-10-21
5.4.12016-09-08
5.4.02016-07-28
5.3.62016-07-20
5.3.52016-05-20
5.3.42016-03-15
5.3.32016-02-23
5.3.22016-01-28
5.3.12015-12-18
5.3.02015-12-08
5.2.52016-06-01
5.2.42015-12-16
5.2.32015-11-19
5.2.22015-10-21
5.2.12015-09-22
5.2.02015-09-08
5.1.52015-06-07
5.1.42015-10-06
5.1.32015-08-24
5.1.22015-07-16
5.1.12015-06-18
5.1.02015-06-09
5.0.42015-07-06
5.0.32015-06-09
5.0.22015-05-13
5.0.12015-04-01
5.0.02015-03-03
4.7.22016-05-31
4.7.12016-02-25
4.7.02015-12-17
4.6.92015-10-15
4.6.82015-08-26
4.6.72015-07-01
4.6.62015-06-08
4.6.52015-04-30
4.6.42015-03-26
4.6.32015-02-19
4.6.22015-01-29
4.6.12014-12-09
4.6.02014-11-25
4.5.52014-10-13
4.5.42014-09-11
4.5.32014-08-12
4.5.22014-07-10
4.5.12014-06-12
4.5.02014-05-27
4.3.42014-01-29
4.3.32014-01-13
4.3.22013-12-18
4.3.12013-11-28
4.3.02013-11-12
4.2.22013-10-10
4.2.12013-09-05
4.2.02013-07-22
4.1.52013-06-08
4.1.42013-06-06
4.1.32013-05-23
4.1.22013-03-26
4.1.02013-03-13
4.0.12013-01-12
4.0.02012-11-13
3.5.72012-12-14
3.5.62012-09-27
3.5.52012-08-08
3.5.42012-07-20
3.5.32012-06-30
3.5.22012-05-15
3.5.12012-04-12
3.5.02012-02-14
3.4.22011-10-26
3.4.12011-09-20
3.4.02011-07-26

Basic editor and code

Layout

Unity basic editor will look like below. Basic functionalities of some default windows/tabs are described in the image.

enter image description here

Linux Layout

There is a little difference in menu layout of linux version, like the screenshot below, enter image description here

Basic Usage

Create an empty GameObject by right clicking in the Hierarchy window and select Create Empty. Create a new script by right clicking in the Project window and select Create > C# Script. Rename it as needed.

When the empty GameObject is selected in the Hierarchy window, drag and drop the newly created script in the Inspector window. Now the script is attached to the object in the Hierarchy window. Open the script with the default MonoDevelop IDE or your preference.

Basic Scripting

Basic code will look like below except the line Debug.Log("hello world!!");.

using UnityEngine;
using System.Collections;

public class BasicCode : MonoBehaviour {

    // Use this for initialization
    void Start () {
        Debug.Log("hello world!!");
    }
    
    // Update is called once per frame
    void Update () {
    
    }
}

Add the line Debug.Log("hello world!!"); in the void Start() method. Save the script and go back to editor. Run it by pressing Play at the top of the editor.

Result should be like below in the Console window:

enter image description here

Customizing Your Workspace

You can customize your Layout of Views by click-dragging the Tab of any View to one of several locations. Dropping a Tab in the Tab Area of an existing window will add the Tab beside any existing Tabs. Alternatively, dropping a Tab in any Dock Zone will add the View in a new window. enter image description here

Tabs can also be detached from the Main Editor Window and arranged into their own floating Editor Windows. Floating Windows can contain arrangements of Views and Tabs just like the Main Editor Window. enter image description here

When you’ve created an editor layout, you can save the layout and restore it any time. Refer to this example for editor layouts. enter image description here

At any time, you can right-click the tab of any view to view additional options like Maximize or add a new tab to the same window.
enter image description here

Editor Layouts

You can save the layout of your tabs and windows to standardize your work environment.

The layouts menu can be found in the upper right corner of Unity Editor:

layouts

Unity ships with 5 default layouts (2 by 3, 4 Split, Default, Tall, Wide) (marked with 1). In the picture above, aside from default layouts, there is also a custom layout at the top.

You can add your own layouts by clicking "Save Layout..." button in the menu (marked with 2):

save layout

You can also delete any layout by clicking "Delete Layout..." button in the menu (marked with 2):

delete layout

The "Revert Factory Settings..." button removes all custom layouts and restores default layouts (marked with 2).

Installation or Setup

Overview

Unity runs on Windows and Mac. There is also a Linux alpha version available.

There are 4 different payment plans for Unity:

  1. Personal - Free (see below)
  2. Plus - $35 USD per month per seat (see below)
  3. Pro - $125 USD per month per seat - After subscribing to the Pro plan for 24 consecutive months, you have the option to stop subscribing and keep the version you have.
  4. Enterprise - Contact Unity for more information

According to EULA: Companies or incorporated entities that had a turnover in excess of US$100,000 in their last fiscal year must use Unity Plus (or a higher license); in excess of US$200,000 they must use Unity Pro (or Enterprise).

Installing

  1. Download the Unity download assistant.

  2. Run the assistant and choose the modules you want to download and install, such as Unity editor, MonoDevelop IDE, documentation, and desired platform build modules.

If you have an older version, you can update to the latest stable version.

If you want to install Unity without Unity download assistant, you can get the component installers from Unity 5.5.1 release notes.

Installing Multiple Versions of Unity

It is often necessary to install multiple versions of Unity at the same time. To do so:

  • On Windows, change the default install directory to an empty folder that you have previously created such as Unity 5.3.1f1.

  • On Mac, the installer will always install to /Applications/Unity. Rename this folder for your existing install (e.g. to /Applications/Unity5.3.1f1) before running the installer for the different version.

  • You can hold Alt when launching Unity to force it to let you choose a project to open. Otherwise the last project loaded will attempt to load (if available) and it may prompt you to update a project you do not want updated.