Unity3D Tutorial - Beginner Basics
Unity3D Tutorial - Beginner Basics
Unity3D Tutorial - Beginner Basics
1. Installing Unity3D
1 Head to http://unity3d.com/unity/download and download the Unity3D
installer for free! It's a large file so be patient! Run it after it downloads.
2 While downloading, make sure you have an e-mail account. You need it to finish installation!
2 Turn the camera by holding the Right-Mouse Button and moving the mouse. Turning
with the mouse like this is called Mouselook.
3 While holding the Right-Mouse Button, move the camera in the using W, A, S, and D.
If you have ever played Minecraft, or another First Person Shooter on a PC, this should be easy.
4 Notice the 3D Scene Gizmo at the Upper Right of the . You'll notice it move
when you Mouselook. It's diagramming the XYZ Axis.
You can imagine the XYZ Axis in real life using a hand gesture, like this:
The Z axis (Depth) is forward, along your pointer finger
The Y axis (Height) is up, along your thumb
The X axis (Width) is to the side, along your middle finger
If you've studied Algebra or Geometry, you might have seen an XY Grid, also called a
Cartesian Plane. The XYZ Axis is like that, but with a Z dimension too!
If you Click on the cube in the center of the 3D Scene Gizmo, you will
toggle how the camera draws 3D, between Perspective and Isometric.
Perspective is how we see in real life.
Isometric is helpful for lining up objects that are far away.
8 If you don't see the Translate Gizmo (as pictured to the right), press ,
in the upper-left of the Unity3D UI.
9 Move the Cube and Point Light closer together with the Translate Gizmo
(colored Arrows and Planes in the ). Drag the Arrows with
your mouse, or Drag the Planes between the lines of the arrows.
10 The Cube should light differently in the as the Point Light
moves. If not, press , at the top of the , to toggle lights.
6. Use the Inspector User Interface
1 Select an object in the or and you'll see its details in the .
You can rename an object with the text field at the top.
Hide this object if you un-check next to the name.
All Game Objects have a , which can be
changed with the text boxes. The Transform consists of:
Position in XYZ space
Rotation, which is how it is turned, on the XYZ axis
Scale, which is how it is stretched across the XYZ axis
You can also use other Gizmos and the mouse to change the
1 To import a Character Controller from the Standard Assets Library, select the menu, then
and .
2 To keep things simple, just press , and wait for it to load. Or to make the project smaller, un-
check the at the 3rd Person Controller.prefab, and every file within PrototypeCharacter/, including
Constructor.FBX, constructor_done.mat, constructor_diffuse.png, and constructor_normals.png.
3 The folder in now has an arrow . Click the arrow to toggle folder listing.
4 Select the Character Controllers folder, which is inside of the Standard Assets folder.
5 Select the First Person Controller, which looks like a Capsule, which is a rounded Cylinder.
6 Drag-and-drop the First Person Controller into the
There are now 2 Main Cameras in your Game! The Scene started with one,
and the First Person Controller came with one as well!
Delete the Main Camera that was in the Scene first, the one not inside the
First Person Controller. Select it and press Delete, or press the Right-
Mouse Button over the Main Camera and select Delete.
This is not required, but may help with debugging scripts later!
8. Play-Test
1 Press the Play button (in the middle, near the top, with one of these buttons )
2 The user interface is now active, and the rest of the UI changed color very slightly.
3 To move the First Person Controller (that was renamed to player), move the mouse (Mouselook), and
use the WASD keys for movement, just like in the . You can use Space Bar to jump!
4 If you fall, you can stop and restart the game by pressing .
5 If your game seems broken, set the player's Position to .
Also, make sure you have a ground cube at Position and
the ground cube's Scale of .
6 While the game is playing, select the player in the , then Click back into the
to give mouse and keyboard focus back to the game. Notice that when you move the
player, the shows the new state of the player's .
7 You can change the details of any Game Object while the game is running with the .
BUT! Any changes you make while in Play Mode can't be saved!
8 You should adjust your Unity settings to more clearly show when the game is running, so you don't
accidentally make changes that can't be saved. Go to , , , and change the
the Position ,
Rotation , and
Scale Gizmos,
hold Ctrl, while
Dragging the mouse.
10. Add a Script Component: Restart After Falling
1 To bring the player back to the beginning if the player falls off of a platform, we will need a script.
2 There's a LOT to learn about scripting, which is a way of saying simple programming. During this part
of the tutorial it may be helpful to have someone who knows about programming around to help you!
3 Press the Right-Mouse Button over the Assets folder, in the .
Then select , and . C# is pronounced See Sharp.
4 Name the script Fall, with a capital 'F'. You can also rename it with the Right-Mouse Button menu.
5 Double-click, or press Enter on the Fall
script in the . Then, wait a
minute or two! The script editor,
MonoDevelop, takes some time to load.
7 The lines with the green next to the line number are the ones you will need to type.
8 Copy this script *exactly*. Every capital letter is capital, and every lowercase letter is lowercase.
9 The curly braces { } are on the keyboard near the Enter key, above and to the right of your right pinky.
10 Save the file in MonoDevelop (with Ctrl + S, or select the menu, then ).
11 You can check to see if your script is correct in Unity by checking the bottom bar: