Asteroids – Introduction to Unity

Hi guys and welcome to a new tutorial series. This is for people who are completely new to Unity and C#.

In this series I will take you through the basics of Unity and how to use C# to do some common things used in games; such as moving an object, creating projectiles and colliding with other objects etc…

For this first part I will briefly describe the different windows within unity and what they do. This part is for people who are very very new to Unity and so is completely optional.

So to begin, open up Unity and create a new project called whatever you like. I am going to call my project Basics Tutorial.

Basics_Intro001
Starting a New Project

Now that Unity is open we have several key windows. Do not worry if your layout looks different to mine, you should still have all the same windows visible when Unity opens.

Basics_Intro002
Unity

The first window we have is the Scene window. This window allows you to view everything currently in your scene.

Basics_Intro003
Scene Window

You can use the hand button in these buttons (below) to help you move around scene in the Scene window. You can also zoom in and out using the mouse wheel and rotate the view using the right mouse button.

Basics_Intro004
Buttons

The next important window is the Game View window. This shows you how you’re game will look. It also will work as the game when the play button is pressed. It is very empty at the moment but that will change later.

Basics_Intro005
Game View

The window shown below is the Project Folders window. This contains all the files which are in the project. Again this is empty at the moment.

Basics_Intro007
Project Folder Window

The next window is the Hierarchy window. It contains all the objects in the current scene. At the moment there should just be the Main Camera and a Directional Light.

The Light adds (as you might expect) light to the scene. Without it the objects will look like they are in the dark.

The Camera is the object which displays what we see in the game window.

Basics_Intro006
Hierarchy Window

Before we move on to the final window please click on the Main Camera object. You should notice the last window, called the inspector window, changes.

Basics_Intro008
Clicking on the Main Camera
Basics_Intro009
Inspector Window after the Camera is Clicked On

The inspector shows you the information about an object. Each section (i.e. Transform, Camera, GUI Layer etc…) is known as a Component. Different objects have different Components depending on their function.

Click on the Light in the Hierarchy window and notice it has completely different components to the Camera.

Basics_Intro010.JPG
The Light’s Inspector

Don’t worry too much about what each of the Components does on the Camera or Light for now. The only one you really need to be aware of at this stage is the transform Component. This is the object’s position rotation and scale within the scene. All objects have a transform. We will return to this in a later part in more detail.

Before we move on the first thing you should always do when creating a new project is save the scene! Like every other program ever you can do this by going to the file menu (I will assume you are computer literate if you are doing this tutorial 🙂 ) or press ctrl + s on your keyboard to save the scene.

Name it what ever you would like. I’m simply going to call mine Scene01.

Do not change the folder from the assets folder of your project

Basics_Intro011.JPG
Save the Scene

You should notice this now appears in the Project Files window.

Basics_Intro012
Scene in Project Window

And that concludes this first part. I hope this brief overview of Unity is helpful. The next part looks at scripts; how to create them and what each line in the default script Unity creates means.

 

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s