Report article RSS Feed Using Unity to Make 2D Games - The Interface

Unity can look a little intimidating from the outside, but once you know what all those buttons do, you get comfortable quickly. This guide will get you familiar with Unity So You know what to do once you download it yourself.

Posted by TonyYotes on Nov 1st, 2013
Basic Other.


An introduction to Unity and the 2D Toolkit interfaces. This is a great way for beginners to see what Unity is like and get an idea of what can be done with it. Sometimes getting a look at the tools you'd like to use helps you ease into them. Since I just made my first Unity game TriGrid recently, I want to share what things came in handy and what all those crazy menus do.

2D Toolkit

The first thing to get for Unity for easy 2D game making would be the 2D Toolkit from Unikron Software. There are plenty of other ones out there but I picked this one because it was the most popular and seems to have the most support, tutorials, and documentation.

 The toolkit is available in the Unity asset store, which looks a lot like the iTunes store but it's full of thing to use in Unity like assets, templates, tools, and interface upgrades. I bought the 2D Toolkit for $60 (USD). It's definitely worth every penny because it has saved me countless hours of frustration and I can now use it for my future projects too. I also could afford it because I got it the same day Unity made it's Android and iOS development packs free. They used to cost $800 total and I had money saved up to buy them, luckily I felt like checking Gamasutra before getting started with my first Unity project and I saw that the kits were just made free for developers! It seems like Unity is constantly doing things to make my job easier.

Unity Layout


The Unity interface is my favorite to use because it let's organize it in any way you'd like and it also has at least three different ways to do the same task, allowing users to pick their favorite. The main things to note here are the Project, Hierarchy, Inspector, Console, Scene, and Game windows. It is possible to cluster and arrange them in any way but I like to have them separated and on either side of the Game and Scene windows with the exception of the Console window (because I don't use it as much) which I paired with the Inspector because one is useful for game setup and the other is useful for debugging.


Make the menu easy for you to use.

Just drag the windows to arrange them.

I even made a couple preset menus for future use, one for landscape games, and one for portrait. I also always make my Scene window bigger than the Game one because that's where I do most of the editing. I like to keep the game window about the size of the actual screen I would play it on.

Project Window

 

In the Project window you can see all the main folders for your project. You can find all your sprites, sounds, scripts, fonts, and scenes here. You can make and arrange folders to stay organized in a way that makes sense to you. The folders are on the left and the highlighted one's contents are on the left. The contents can be shown as images or icons with text and you can use a slider to change their size.

Hierarchy Window


In the Hierarchy window you can see all the things active in the game scene. All instantiated objects are listed here, including any clones. You can also see all the child objects by clicking on the arrow next to the parent object and finding them in the list that comes out. I often use it to arrange menu items by putting all the buttons as children of a button near the center of the screen so they are always aligned the way I want them.


Selecting something in the Hierarchy window makes it's information appear in the Inspector window and also highlights the object in the Scene window.

Inspector Window


In the Inspector window you can change the properties of objects. You can add scripts, components, and sprites to objects. Scripts make the objects act, components can enable things like physics and sound, and sprites can be picked out of sprite collections.

 
It's a nice little info tab for everything and it lets you change object properties easily. You can even move the components around and move the stuff you like to use most to the top.


You can see a preview of a script's code here when you select it in the Project window. It's nice to see if you need a quick reminder of what code it is. It's more useful if there is code documentation commented at the top telling what the script does. In regular code, things are arranged in classes with methods but in Unity, objects are basically a given and you just need scripts to tell them what to do.

Console Window


In the Console window you can see error messages and text you call with the console menu. Think of it as the same console window in any programming application, where all the System.out.println or cout << stuff would go.

Scene & Game Window

In the Scene window you can drag and drop objects, move them around the scene and in the Game window you can see how they look in game. There are play, pause, and forward buttons that affect the game. When testing the game, pausing becomes useful. You push play to start playtesting and you can pause to alter things in the game scene. Just remember: all changes made while the play button is lit will not be saved! Also, I've never used the forward button.
Not even sure what it does really.


The Scene window also will show things that may be hidden in the actual game. The game screen has a lot of preset display sizes and the Game window has lots of playtime stats it can display with a switch at the top.

Build Window


When you're ready to build and test on a device this menu pops up. You can drop and drop all the scenes you want in the game then pick a platform to make the game for. Then just follow a few steps to plug in a device and Build & Run.


You can also select things like icons and platform specific settings.

Scripts & Sprites


Unity has it's own script editor, MonoDevelop which makes it easy to change code for the game and test it quickly. You can code in JavaScript, C#, or Boo. You can keep them all open, or just use the scripts you edit most. You can even open MonoDevelop without opening Unity.


When importing sprites you just drag & drop from your documents and select it in the Project window. When you do you can alter it's settings for transparency and resolution. When you push the open button you can either edit it or look at a preview depending on your computer's default reaction to double clicking an image file.

After that making a sprite objects with 2D toolkit is a matter of going to the Hierarchy window and pushing the create button.


2D toolkit has sprite images stored in Sprite Collections you make to use for the Objects in the game. You drag & drop the sprite files from Project to the Sprite Collection and then attach collision boxes and anchor points. Sprite images can only be used if they are in sprite collections. Make sure to press the Commit button in the top right corner before and after working with the sprites every time. Otherwise you'll find yourself in a mess.

Polygon colliders let you make weird shapes

Once you get familiar with the environment and watch a few tutorials, using Unity will be as easy and natural as navigating a web browser. Hopefully this little walkthrough gave some insight into how Unity works and feels. Now with this new knowledge open it up and give it a try!

Post comment Comments
Guest
Guest Nov 2 2013, 9:08am says:

Good tutorial.
$65 is a lot of money in some countries so not so easy.

+2 votes     reply to comment
TonyYotes
TonyYotes Nov 5 2013, 3:53pm replied:

Yeah, money can get hard to come by. That's why I save up for things like this instead of spend it all on games I want to play or random fast food.

+1 vote     reply to comment
juicytoot
juicytoot Nov 5 2013, 5:22pm replied:

Random fast-food is pretty good. In my case i blow my money and magic cards.

+1 vote     reply to comment
robertrinfret
robertrinfret Nov 2 2013, 10:16am says:

The 2d kit is on sale right now for $30, grab it while you can :)

+2 votes     reply to comment
WeeGee9000
WeeGee9000 Nov 6 2013, 6:13pm says:

but what is this doing on the psp section?

+1 vote     reply to comment
Guest
Guest Nov 19 2013, 11:23am replied:

This comment is currently awaiting admin approval, join now to view.

Yldrania
Yldrania Nov 28 2013, 11:27am says: Online

That's exactly what I was looking for. Thank you a lot!

+2 votes     reply to comment
TonyYotes
TonyYotes Feb 8 2014, 11:29am replied:

Happy to help whoever I can.

+1 vote     reply to comment
PhillipPbor
PhillipPbor Dec 19 2013, 6:57pm says:

I ONLY GOT AN KINDLE FIRE!

+1 vote     reply to comment
TonyYotes
TonyYotes Jan 21 2014, 10:54am replied:

You can still test out android games for amazon on your device. I even uploaded TriGrid for the amazon market.

+1 vote     reply to comment
javierandooo
javierandooo Feb 25 2014, 6:22pm says:

Muy buen aporte me a servido de mucho

+2 votes     reply to comment
Post a Comment
click to sign in

You are not logged in, your comment will be anonymous unless you join the community today (totally free - or sign in with your social account on the right) which we encourage all contributors to do.

2000 characters limit; HTML formatting and smileys are not supported - text only

Tutorial
Browse
Tutorials
Report Abuse
Report article
Related Games
Candy Shop Catch
Candy Shop Catch Indie Single Player Arcade
TriGrid
TriGrid Indie Single Player Arcade
Related Engines
Unity
Unity Commercial Released May 30, 2005