Boring Completely Skippable Intro
This blog post will cover introductory topics for getting started with 2D Game Development using the Unity Engine.
Have you ever wanted to make a game but had no idea where to start?
Luckily, there are some really great tools for making games out there these days!
My personal opinion is that there are no wrong answers except that Unity is the best and if you disagree then GO'ON GIT!....
to reading this article and maybe you will change your mind.
This article is intended to give a very high level look at getting setup with Unity after you have already decided that it is the best option. A quick look at the table
of contents will show you that this article covers:
- initial setup of Unity (download and install)
- creating a new project
- a brief introduction to the main Unity Editor
- and then finishes up with some extra content to help aid your game development journey.
Table of Contents
- Creating a Project
- Editor Introduction
Already have Unity setup? Checkout the Extras!
The first thing we will have to do is download and install Unity. Unless you are a small studio or experienced developer with need for the paid options, the Unity Personal edition should be plenty for you to work with.
- Download Unity Personal Edition here: Unity Personal Edition.
(You can also get here by starting at unity.com and navigating their menu to find the Get Started button)
- After the download is complete, run the installer.
Note: This will install Unity Hub, which is Unity's launcher application used to manage Unity versions, projects, and tutorials. After installing Unity Hub, you select which versioin of Unity to install.
The Unity Hub launcher is a handy tool for working with multiple versions of Unity (nice for having a stable copy and a beta version for testing), managing your projects, and finding sample projects and learning resources.
If you wish to skip the launcher installation you can find a direct download link in the Unity download archive. For this tutorial we will be using version 2019.4 LTS* or higher
- Select your Unity version - 2019.4.* or higher
- Select the build tools the target platform for your game. (Don't worry, you can always come back and add these afterwards if you aren't sure or want to change anything later.)
- Recommended I recommend installing Visual Studio Community because it is an excellent tool to help speed up your game development
- After READING and agreeing to some licenses the installation should just need some time to finish up and complete.
Start Unity Hub and in the top right corner click on the profile icon, and sign into your Unity account
For our example we will be using Unity Hub, but even if you opted for a direct Unity installation the project creation process is fundamentally the same.
If you happen to have an existing Unity project you can open it easily or Add it into Unity Hub for easy opening and management. But this is a getting started tutorial so lets move forward with a New project instead.
- Open Unity Hub > Projects > Click on New
- Select the 2D option, give your project a name and location where you would like the project files to be stored
- Click Create
- Do a little dance while you wait for Unity to get things setup for you
There is obviously entirely too much to explain about the editor in a simple blog post but I will touch on some basics that can help guide you in the right direction for your next steps.
The first thing to comment on is the difference in a 2D project vs a 3D project, and the answer is: not much (initially). Honestly the only difference is a few small preset options that Unity sets up for you based on which project type was selected. Most notably some settings on the default Main Camera and the scene view. Both of which can be easily switched. Check out this Unity documentation for more information
When you open your new project you should be greeted with a window that looks something like this (Default layout):
One of the key concepts of Unity is the idea of organizing a game or project into Scenes.
- A Scene is just a portion of the game and they can range in size from very small and simple for things like a title screen, or massive in size and scope like a sprawling 3d city environment for an exploration game.
- A Project can have multiple scenes or just one if the developer chooses
- Each instance of Unity can only have one project open at a time
The two main ways to interact with your game are through the Game and Scene windows inside Unity. At first glance these two windows may look similar, but they are quite different.
Let's add our first Game Object to our scene.
Under the Project window Right click anywhere and Select > 3D Object > Cube
The Game view shows you the view that the Player will see. It represents what is currently being rendered by the Main Camera or any other cameras that make up the visual aspects of your game
(The only way to interact with the Game view is by clicking the Play button in the Unity editor and starting your game)
The Scene view is where all of the magic happens. This is where you spend the time building out the content of what is "in" your game. Any Game objects or cameras or environment or UI elements are all managed through the Scene view
There are tons of windows for various tasks throughout the Unity editor but if you are just getting started you can worry about the rest later. The three main windows to focus on are:
- The Project window is a pretty standard "file explorer" type view that represents all of the Assets (Art, Music, Scripts, Gameobject Prefabs, etc.) You may not have much in here to start except for the Scene that was created along with your new project or if you have imported any other assets for use.
- The Hierarchy window displays all game objects that are currently in the active Scene. Game objects can be parented under one another to create a hierarchy, and all Game objects in a scene are children of a Scene object.
- The Inspector window displays detailed information about the currently selected Game object. Game objects can be manipulated by changing values in the Inspector window, or using tools in the Scene view. If no Game object is selected this window is empty.
Here are a few optional extra steps you can take to enhance your game development journey. Whether you are just getting started or are curious to learn more check out some of the information below!
One of the coolest things about Unity is how easy it is to find amazing assets of all kinds for just about any project you might be working on. Even if you are a do-it-yourselfer I highly recommend checking out at least some of the free assets that are available to help jump start your development.
By far one of the biggest reasons I love Unity so much is all of their amazing learning resources. And now it is more accessible than ever by having it embedded directly into Unity Hub for immediate access. Unity Learn has a built-in library of tutorial and sample projects that are easily downloadable to make diving into a new learning experience easier than ever.
There are a huge variety of topics to choose from and if you aren't sure where to get started there are even some tools to help you pick a place to start. If you don't have Unity Hub installed you can find all of the same material and more on the unity website here: Unity Learn
Version control is practically ubiquitous in some form or another in the technology industry. It can reduce the risk of making changes on a project by creating branches off of a code base and saving a project at various states in it's production can let a developer easily revert back to a working state should something go horribly wrong.
Even if you are a solo developer, you can benefit from building good development habits and use version control. If you are working with a team then some form of version control is critical for safely working together without stepping on each other's toes. To learn more about version control and getting your Unity project setup for it check out this article: Version Control in Unity
Hope you enjoyed the article! Here are some of the resources I used when writing this article.