Reinforcement learning with Unity Part 1 – what is Unity and how do I get started?

Josh Yang
4 min readSep 16, 2021

--

Hi everyone, I am setting out to publish a series of articles to help anyone who is interested in implementing Reinforcement learning using Unity. This is the very first part of the journey, so let’s get started!

Background — What is Unity?

Unity is a game engine where you can make and develop cross-platform games from scratch. There are quite a few game engines out there but Unity has been my choice as the community is huge and their support seemed to be amazing. For example, they have a forum on every topic where you can ask questions and get help very quickly. They also have extensive API documentations and great supports on their GitHub repositories for any package you might be using.

Unity is such a versatile engine that you are not limited to just making games; you can make simulations of all sorts (modelling cars to buildings) as well as making animated films! You can even easily get into augmented reality (AR) or mixed reality (MR) as companies like Microsoft have developed a toolkit for Unity.

So now we have had some introduction to what Unity is let’s get started straight away.

Install Unity Hub

Unity Hub is a software by Unity that helps us to manage different projects with different versions of Unity we may have from long-term support (LTS) versions to Beta versions. So we will first download Unity Hub.

*I am currently using Ubuntu 20.04.2 LTS but even if you are using Windows or MacOS the steps shouldn’t differ too much.

*You should also make an account with Unity if you already haven’t done so.

So first, you need to go to the download page and click on “Download Unity Hub” and install Unity Hub once the installer is downloaded.

When the Unity Hub is installed launch the software and log in. Then you need to activate your license: click on the settings cog wheel button on the top right and go to “License Management” on the left panel. Click on “Activate New License” and follow the steps that applies to you. You can see what it looks like below:

Install Unity LTS version

Go to “Installs” section in Unity Hub and click on “Add” button. We will install the latest LTS version of Unity which is 2020.3.18f1 at the time of writing this article.

You can add modules that suits your needs such as build support for iOS and/or Android. But for now we will just select Linux Build Support (IL2CPP) (choose Windows or Mac Build Support if you are working on one of those machines!)

Create a project

We can now create a project!

First we need to go to “Projects” section and then on the top right hand side there is an arrow button next to the “New” button. Select the Unity version we just installed and a new window will pop up. If it doesn’t just click “New”.

We will click on “3D” under Templates pane and under the Settings pane we will name this project “OurFirstProject”. The location of the project must be where we have installed our Unity LTS version (you can check the installation location by clicking on the settings cog wheel button the top right hand side. The path is shown in “Unity Editors Folder” in General).

Open the project

When you first create a project it will automatically open. But when you want to open the project later you can open it by clicking on the project in Unity Hub under Projects.

Once the project is open you will see a default blank project shown below.

That’s it!

We have installed Unity and created our first project!

In the following article we will go through setting up Unity for scripting so we can later create an object and move that around!

Thank you for reading this article and hopefully this was helpful!

--

--