A Bite-Sized Guide to Unity

You can access the full course here: Bite-Sized 3D Game Development

Part 1

In this first lesson you will learn what Unity actually is and you will get Unity Hub and the Unity Editor installed.

What is Unity?

Unity is currently the world’s leading game engine. Unity has an extremely low barrier for entry for customers entering into the game development world.

Unity is capable of creating both 2D and 3D games that are both AAA quality.

Unity uses C# and C# is a Microsoft language.

Export from Unity to just about any platform: PC, Mac, mobile, consoles, and just about anything else in between.

Installing the Unity Hub

You will need to install the Unity Hub in order to get started with the course, and we need the Unity Hub installed before we can get the editor installed.

You can install the Unity editor without the Hub, but the Hub allows us to manage multiple versions of the editor if you would like, you will also be able to manage all Unity projects across installations, and find training resources.

The Unity Hub can be downloaded here: https://unity3d.com/get-unity/download

The direct link is here: Unity Hub

There are three different versions for Unity: Personal, Plus, and Pro. The personal version is completely free and you can use that version to complete the course.

Unity store plan options

Download Unity personal page

Once you download the Hub follow the setup instructions during installation and accept the agreement:

Unity Hub Setup Terms of Service

Unity Hub setup installing

Once the Unity Hub is installed you can begin installing the editor. 

Make sure to select the Installs tab:

Unity Hub with Installs link pointed to

Go down to Official Releases and download install the latest version available.

Unity 2018.2.1 Download button selected

Feel free to install the extra options available such as the Android Build Support or iOS Build Support, but for this course you really just need the editor and the documentation installed.

Unity components install options

Once you have the editor installed you can continue on to the next lesson.

Part 2

In this lesson we will work on positioning objects right where we want them to be in the scene.

We currently have a cube game object in the scene, and if we look in the Inspector window we can see that the cube does have a transform component. On this transform component the cube has a position, rotation, and a scale.

Unity scene with cube added and Transform component

We will focus on the position right now, and you will see that the cube has some values for the X, Y, and Z axes. The values are kind of crazy right now, and we can change these.

We can decide what X, Y, and Z coordinates the object needs to have and then we can assign the values to it. So we can type the number “0” into each one of the value fields and the cube game object will be placed at the origin. The origin is simply the 0,0,0 coordinates and this is exactly at the center.

Unity cube with transform position adjusted

You can also just grab the move tool to have more free form control over moving the game object.

You can move the cube on specific axes, just by selecting the X axis lets say and moving it specifically on that axis.

You can duplicate the cube in the scene we have currently by hitting Ctrl + D on the keyboard. This will make a duplicate for whatever object you have selected when you hit Ctrl + D.

Unity scene with duplicate cube

So now we have the two cubes in our scene. What if we wanted to place the cubes up against each other? You can always just drag one cube over on the Z axis and try to get it to meet up to one another.

The easiest way to get objects to meet up with one another, is by using the surface snap option for the move tool.

You can get objects to match up perfectly by snapping vertices. You can do this by holding down the V key and hovering over the vertex that you want and it will snap to the nearest vertex available.

Unity scene with cubes snapped by vertices

If for some reason you were moving objects around in your scene and you then cannot locate them you can find them again by double clicking on the object in the Hierarchy or you can already have an object selected and hit the “F” key, this will frame the game object right in the center of the screen for you.

Snap Settings

You can snap to coordinates by holding down the Ctrl key and moving the object. This will snap it to the grid one cell at a time.

You change your Snap Settings in the Unity editor by going to Edit>Snap Settings.

Unity Edit menu with Snap Settings selected

Then change the Snap Settings right in the window that pops up:

Unity Snap Settings window

Positioning Challenge

  • Correct object positions to make a tree.

Opening up the Challenge scene, you will see this:

Disassembled tree in Unity scene

We can start by moving the Top of the tree. Select the game object called “Top” and hold down Shift + Ctrl, and snap the surface of the bottom to the top of the trunk.

3D tree in Unity with green cube added on pole

Now select the Branch and use Shift + Ctrl, drag, and point at the surface of the Trunk.

3D branch snapped to trunk in Unity

Select the Top 2 object and snap it using vertex snapping to the Top of the tree.

3D leaf bunch snapped to top of tree in Unity

Select the Top 4 game object and snap it to the Top of the tree.

3D leaf bunch snapped to side of tree in Unity

Now we can take the Branch Top and add it to the end of the Branch use Shift + Ctrl.

3d leaf bunch snapped to bottom of tree in Unity

Now take the Top 3 game object and position it at the bottom right on the Top of the tree.

3d leaf bunch added to side of tree model in Unity

Then look in the Game view and you will see the tree:

Unity game screen with 3D model tree positioned

 

Transcript 1

Hey guys, my name is Austin Gregory, and in this course we’re gonna learn Unity from scratch.

The goals of this course are gonna be to learn Unity’s tools and interfaces, learn how to manipulate objects with transformations, like moving them, scaling them, rotating them. We’re going to learn how to snap them together using vertex and surface snapping. We’re gonna learn how to create materials to apply colors and textures and shaders to objects. We’re gonna learn the very basics of programming and the concepts of programming. And I’m gonna take that knowledge and learn some object-oriented programming, just the basics though, just to get the idea of what it is. And I’m gonna talk about some vectors.

We got a lot more as well, but that’s just the gist of it. And it’s completely for beginners, no experience required. Don’t have to know anything about Unity. We’re even gonna walk through installing the editor and Unity Hub and all that. That’s coming up in this course, guys. My name is Austin, and I will see you in the first lesson.

Transcript 2

So let’s get started by downloading Unity Hub. So what I’m gonna do, is I’m gonna go over to unity3d.com. And there’s a lot of information on the homepage here, that will teach you a bit about what Unity can do. So for now, though, all we care about is this Get Unity button, right here. I wanna click on that and that link’s gonna take me to the Store page, store at unity.com.

So we wanna click on Try Personal, and I’m gonna go ahead and check that I confirm all this stuff here, of course. And what I’m gonna do, is I’m gonna download the Hub. Now like I said, you could download the Installer for the editor, directly, but I don’t wanna do that. I want the Hub. So I’m gonna download Unity Hub, and I’m gonna run this Installer. And when you do, you’re gonna see a simple agreement to the terms of service. We know how to do that, just gonna agree to that. And if you wanna read it, go ahead. And then we’re gonna slide through one and install it. In my case, I just keep it right inside the program files there.

And now this shouldn’t take too long to install, simply because you’re only installing the Hub itself, you’re not installing Unity itself, at this point. So once this finishes, though, we’re gonna jump in there, and we’re gonna actually start installing the editor.

What we’re gonna do here, is once Hub is open, we’re gonna go to the installation tab; we’re gonna go down to Official Releases and we’re gonna find their latest version that’s available. To me, it 2018.2.10f1. We’re gonna download that and then let it install.

Now, whenever I click download, it’s going to open up this window here that’s going to allow us to select some components. There’s a lot of stuff here, but the important thing to remember, you can always come back later and install what you do not have, if you need it. In my case, I don’t need Android Build, or iOS Build, or Linux, or all that stuff down here. There’s gonna be a lot of options. But in my case, I just want the Documentation and the latest version. And then we’re gonna click done. And when we do that, it’s gonna start installing that version of Unity, with those settings. And again, you can always come back and add the components you need.

And that’s gonna be all we have to do to install Unity on our systems.

Transcript 3

Hey, guys, welcome back. In this lesson, we’re going to look at positioning objects in our Scenes.

So in our current Scene, we have a cube object. And if I look up here, now, (we touched on this a second ago), but if I look up here now, I have a Transform with a Position, Rotation, and Scale. And I see X, Y, and Z values, and they’re pretty crazy values; and we’ll change those here in a second. And now, what’s important about this is that’s how we position things in our world. We decide at what X, Y, and Z coordinates the object is. So if I were to take this and say X, Y, and Z is zero, that’s gonna be directly in the center of our game world.

I can also have a more freeform control of this by just grabbing the Move tool that we have selected here. I can just move it on the x-axis just like this. It will only move on the x-axis if I do that. And the same goes for the Z and the Y. Now maybe I wanna move it on the Z and the X at the same time. Well, I’ll grab green, there we go. And the same goes for the red here. And then blue: move it on the X and Y.

Let’s create another cube here. I’ll just select this cube, and I’ll hit Control and D on the keyboard. I have it selected, so what I can do is I can just move it out. Now, one thing that’s important is what if I wanted to place this cube directly up against this cube. I can hold down Control and Shift, and doing this is going to enable the surface snap option for the Move tool. Now, if I were to click and drag, notice once the mouse is over another surface, the object snaps to that surface. So I can just snap these vertices together by holding down V, hovering over the vertex that I want, and I just drag it, and it will snap to the nearest vertex available to it. Boom, there we go. Now, we are right up against each other just like we need to be.

Now, just a tip, what if I’m moving some stuff around here and this just gets way off screen somehow and I don’t where it’s at. I’m trying to find it, I can’t find it. So, I can double-click on Cube 1 here, it will frame it right in the center for me. Or I can have an object selected, and I just hit the F key and that will frame it.

Now, let’s position this back as zero, zero, zero, because what I wanna do is talk about some snap settings. Now, we snapped surfaces together, we snapped vertices together, but now, I wanna simply snap to a coordinate grid. One way I can do that is I can hold down the Control key as I’m moving the object, and it’s gonna snap to the grid. But what if I don’t want it to move one at a time?

Well, I can fix that by going up to Edit, down to Snap Settings, and I can change this right here. It can change them on the individual axes as well and also, scale and rotation snapping (which we don’t need that). Let’s say I have this off position here, and I wanna snap it to be one unit each; I could just have it selected and say Snap All Axes, and it snaps them all to the nearest unit that matches our snap settings. Or I could just say, well, I wanna snap just the X, I wanna snap just the Z, and then just the Y. But the Y’s already there, so then just the Y. Pretty cool.

So, that’s a good way to start moving stuff around if you need a uniform type of layout for your level.

Interested in continuing? Check out the full Bite-Sized 3D Game Development course, which is part of our Bite-Sized Coding Academy.