In this tutorial, you will learn how to create and manipulate 3D game objects in Unity. You will create a new 3D project and scene from scratch. Then you will add 3D cubes and spheres to the scene as game objects. You will organize the game objects in the hierarchy and use the inspector to view and edit their transform properties like position, rotation and scale. You will also learn how to parent game objects to create more complex structures and control them as a group. The goal is to build fundamental skills for using the Unity editor and working with 3D game objects.
Powerful Google developer tools for immediate impact! (2023-24 C)
Unity - Building your first real-time 3D project
1. Summary
In this learning project, you will be introduced to some of the essential tasks of an artist, game developer, or
other creator of interactive 3D experiences. You’ll explore the 3D capabilities and features of Unity, starting
with creating and manipulating 3D objects. You will learn about components, which give you control over the
ways objects look and behave. You will control lighting effects and experiment with Materials, which give 3D
objects a realistic appearance.
Project Objective
By the end of this learning project you will be able to:
● Create a new 3D project.
● Create 3D objects in the Unity Editor.
● Move, scale, and rotate objects in 3D space.
● Control the properties and behaviors of 3D objects using components.
● Create and apply a Material to a 3D object.
● Adjust the Directional Light in a 3D Scene.
● Find and import 3D assets from the Unity Asset Store.
● Publish a 3D project.
2. Summary
In this tutorial, you’ll begin working in the Unity Editor with more independence than you might have experienced
with the Microgames. Using a new Unity project and 3D Scene you create from scratch, you will work with
GameObjects and explore the various ways you can manipulate them in the Unity Editor. In this tutorial, you will:
● Create new 3D GameObjects.
● Select 3D objects in both the Hierarchy and Inspector windows of the Unity Editor.
● Move, rotate, and scale 3D objects using numerical values using the Transform Component in the Inspector
window.
● Move, rotate, and scale 3D objects in the Scene view using the Unity transform tools.
● Link GameObjects in parent-child relationships using the Hierarchy window to create complex
GameObjects.
● Identify the relationship between the properties displayed in the Inspector and the display of GameObjects in
the Scene.
3. 1.Overview
In this tutorial, you’ll apply what you have learned about the Unity Editor as you create and manipulate GameObjects in a Scene.
You’ll build more fundamental skills as you learn how to use the Hierarchy and Inspector windows to organize and configure your
GameObjects.
4. 2.Before you begin
Get familiar with the Editor controls
In this tutorial, you’ll begin using the techniques you learned in a Microgame and in the previous Unity Essentials mission. As we go
through the next learning projects, we assume that you can manipulate GameObjects and navigate in 3D space.
To review, see Explore the Unity Editor for basic techniques, tips, and tricks.
Try a Microgame
If you are new to Unity and you haven’t already taken the tutorials in one of the Microgames available in the Unity Hub, we highly
recommend them — especially the LEGO® Microgame! Any of these Microgames will give you a good introduction to the Unity
Editor. Note: If you completed the LEGO® Microgame, you used some custom functionality that recreates the experience of using
physical LEGO® bricks inside the Unity Editor. Here, you will not see the special LEGO enhancements — you’ll be using the
uncustomized Unity Editor.
5. 3.Create a new 3D project and Scene
Important: If you have already created a Unity project named “Essentials 3D project” in a previous mission, open that project from
the Unity Hub and skip this step.
Follow these steps if you need to create a new Unity project for this tutorial:
1. Open the Unity Hub.
2. Create a new Unity project using the 3D Template. Name this project “Essentials 3D project.”
Note: You might see a prompt to download the 3D Template if this is the first time you have used it. Look for this prompt on the 3D
card when you select it.
3. Create a cube primitive in your empty Scene: right-click an empty section in the Hierarchy and select 3D Object > Cube.
6. 4.The default 3D Scene
In the Microgames, you started in a Scene
that was already built for you, with characters
that moved and responded to your
commands, a rigid ground on which they
traveled, and goals and obstacles to make
the game interesting. Now, however, you are
working in vast, boundless, empty space. A
plane that looks like the ground is just for
reference — it is not even a rigid surface.
The default 3D Scene comes equipped with two important GameObjects, which are listed in the Hierarchy window:
● Main Camera, which controls what your players will see in the Game view (Play mode)
● Directional Light, which simulates the sun and provides light that will reflect off 3D your GameObjects to create realistic
visual effects
We will return to these after you have added some GameObjects to your Scene — so that the Main Camera has something to
view and the Directional Light has something off which to reflect.
7. 5.Work with GameObjects in the Inspector
The Inspector window is where you will view and change the properties of GameObjects and other types
of objects.
1. In the Scene view, select the cube GameObject you have created.
2. With Cube selected, look at the GameObject’s properties in the Inspector window.
Each section of the Inspector represents a component, which is a set of properties and behaviors of the
selected GameObject. Some components are built-in to primitives like the ones you see here. Later, you
will add more components to give GameObjects more sophisticated properties and behaviours.
With the Cube selected, the Transform Component displays the size, rotation, and position of the Cube in
the Scene using X,Y, and Z values. By default, these values are meters.
Note: Unity uses a Y-up coordinate system. This means that in the Editor screen space, the Y direction
is vertical and X and Z represent the horizontal plane (similar to north, south, east, and west). Some 3D
applications, such as 3DsMax, use Z as the vertical.
8. 3. Select F on the keyboard to focus on the
Cube. (Tip: The Scene view window must be
activated; you can select a GameObject in
Scene view, or right-click anywhere, to
activate the window.)
5.Work with GameObjects in the Inspector
By default, the Move tool is selected, and its
Gizmo is located in the center of the cube.
The arrows point in the positive directions in
each dimension. The dimensions are color
coded. You can always get your bearings by
looking at the Scene Gizmo in the upper
right corner of the Scene view.
9. 5.Work with GameObjects
in the Inspector
4. With the Cube selected, change the Y
value of the Scale in the Transform
Component to 4. The Cube height will
change to 4. Zoom out as needed.
10. 6.Organize GameObjects in the Hierarchy
You can use the Hierarchy window to organize your GameObjects and
define their relationships to each other. You can group them in the
Hierarchy to create more complex GameObjects.
1. Right-click the Cube in the Hierarchy window so that it is selected.
2. Select 3D Object > Sphere.
As shown in the Hierarchy, the Sphere is a child GameObject of the
Cube. These two objects are now linked. You can operate on them as a
unit.
11. 3. This sphere is inside the Cube where you can’t see it. Select
Sphere in the Hierarchy, and the Gizmo will appear so that you can
move it in the Scene view to a location at least partially visible
outside of Cube. It will be tall, not spherical, because its initial
dimensions were based on its parent.
6.Organize GameObjects in the Hierarchy
4. Select the parent object, Cube, and move it. Cube and Sphere
will move together. Try scaling and rotating your object, too.
To remove the parent-child relationship, drag the Sphere in the
Hierarchy up and all the way to the left, to indicate the root level.
Both GameObjects now appear as independent GameObjects in the
Hierarchy.
12. 7.Next steps
You’ve seen how to add simple GameObjects, called
primitives, to your Scene, and you’ve seen the ways these
GameObjects are represented in the Hierarchy and
Inspector windows. You’ve seen how to move, rotate, and
scale GameObjects two ways: with numbers in the
Inspector, or by physically changing them in the Scene
view.
Now you’re ready for a practical exercise: building a
structure using primitives.