Lesson 1.1 - Start your 3D Engines

Tutorial

·

Beginner

·

+10XP

·

80 mins

·

(6873)

Unity Technologies

Lesson 1.1 - Start your 3D Engines


Overview:

In this lesson, you will create your very first game project in Unity Hub. You will choose and position a vehicle for the player to drive and an obstacle for them to hit or avoid. You will also set up a camera for the player to see through, giving them a perfect view of the scene. Throughout this process, you will learn to navigate the Unity Editor and grow comfortable moving around in 3D Space. Lastly, you will customize your own window layout for the Unity Editor.

Project Outcome:

You will have a vehicle and obstacle positioned on the road and the camera set up perfectly behind the vehicle. You will also have a new custom Unity layout, perfectly optimized for editing.

Languages available:

Overview Video

1. Make a course folder and new project

The first thing we need to do is create a folder that will hold all of our course projects, then create a new Unity project inside it for Prototype 1.



  1. On your desktop (or somewhere else you will remember), right-click > create New Folder, then name it “Create with Code”

  1. Create a new Unity project using the Universal 3D template - remember to use a version of Unity 6.
    For a reminder on how to create a new Unity project, you can reference this tutorial.

  1. Name the project “Prototype 1” and set the file location to your new Create with Code folder.

  1. Select Create Project, then wait for Unity to open your new project.

2. Import assets and open Prototype 1

Now that we have an empty project open, we need to import the assets for Prototype 1 and open the scene



  1. Download the Prototype 1 Starter Files, then extract the compressed folder.
    Windows: Right-click on the file > Extract All.
    Mac: Double-click on the file.

  1. Import the asset package into your Unity project
    For a reminder on how to import packages, you can reference this tutorial.

  1. In the Project window, in Assets > Scenes > double-click on the Prototype 1 scene to open it.

  1. Delete the Sample Scene without saving.

  1. Right-click and drag to look around at the start of the road.

3. Add your vehicle to the scene

Since we’re making a driving simulator, we need to add our own vehicle to the scene.



  1. In the Project window, open Assets > Course Library > Vehicles, then drag a vehicle into the Hierarchy window.

  1. Hold right-click and WASD to fly to the vehicle, then try to rotate around it.

  1. With the vehicle selected and your mouse in the Scene view, press F to focus on it.

  1. Hold alt + left-click (on MacOS: option + left-click) to rotate around the focal point or hold alt + right-click to zoom in and out.

  1. Use the scroll wheel to zoom in and out and hold the scroll wheel to pan.

  1. If anything goes wrong, press Ctrl + Z (macOS: Cmd + Z) to undo until it’s fixed.

Important: You will orbit around the last object that you framed in the Scene view. So it’s important that you first Frame the vehicle (by pressing F), and only then try rotating around it.


4. Add an obstacle and reposition it

The next thing our game needs is an obstacle! We need to choose one and position it in front of the vehicle.



  1. Go to Course Library > Obstacles and drag an obstacle directly into the Scene view

  1. In the Inspector for your obstacle, in the top-right of the Transform component, click the more options button > Reset Property > Position.

  1. In the Inspector, change the XYZ Location to x=0, y=0, z=25

  1. In the Hierarchy, Right-click > Rename your two objects as “Vehicle” and “Obstacle

5. Locate your camera and run the game

Now that we’ve set up our vehicle and obstacle, let’s try running the game and looking through the camera.



  1. Select the Camera in the Hierarchy window, then press F to focus on it.

  1. Press the Play button to run your game, then press the Stop button to exit Play mode.

Note: If you don’t see your camera preview, you need to enable the Cameras option in the overlay menu in the Scene view.



6. Move the camera behind the vehicle

In order for the player to properly view our game, we should position and angle the camera in a good spot behind the vehicle



  1. Use the Move and Rotate tools to move the camera behind the vehicle looking down on it

  1. Hold Ctrl/Cmd to move the camera by whole units

7. Customize the interface layout

Last but not least, we need to customize the Unity Editor layout so that it’s perfect for editing our project.



  1. In the upper-right corner, change the layout from “Default” to “Tall”.

  1. Move the Game view beneath the Scene view.

  1. In the Project window, open the dropdown menu in the top-right and select One-column layout.

  1. In the layout Dropdown, save a new Layout and call it “My Layout”.

8. Lesson Recap

New Functionality


  • Project set up with assets imported

  • Vehicle positioned at the start of the road

  • Obstacle positioned in front of the vehicle

  • Camera positioned behind vehicle

New Concepts & Skills


  • Create a new project

  • Import assets

  • Add objects to the scene

  • Game vs Scene view

  • Project, Hierarchy, Inspector windows

  • Navigate 3D space

  • Move and Rotate tools

  • Customize the layout

Next Lesson


  • We’ll really make this interactive by writing our first line of code in C# to make the vehicle move and have it collide with other objects in the scene

Complete this tutorial