Car Tutorial Unity3D

Páginas: 13 (3194 palabras) Publicado: 24 de abril de 2012
“The Car Tutorial” Part 1
Creating a Racing Game
for Unity

unity

“The Car Tutorial”― Creating a Racing Game for Unity, Part 1

Introduction

3

Skidmarks

11

We will show

3

Max Marks

12

Prerequisites

3

Mark Width

12

We will not show

4

Ground Offset

12

5

Min Distance

13

Adding Collision

6

Texture

13

Shadow settings forthe car model

7

Adding Sound

14

Adding the Car’s Components

8

Finalizing the Assembling

15

Part 1: Assembling the Car

Adding a blob shadow

10

“The Car Tutorial”― Creating a Racing Game for Unity, Part 1

unity

Introduction
The aim of this tutorial is to show you how to create a racing game with Unity. We are going to
assemble a car from a 3d model, scriptsand Components. We provide you with a complete project
of a driving game, where you can play with a finished scene and explore how everything is put together. We also provide you with a scene that has everything ready but the car, which you will then
work on completing.

We will show
Let us begin by talking about what this tutorial will deal with. It is divided into three distinct sections thatcan worked on independently of each other:

1. Assembling the Car
How to assemble a Car Prefab from a 3D model, scripts and components. This is the section you are
reading right now.

2. Tweaking the Car
How to tweak the car to behave “better” or in different ways.

3. Under the Hood
A more in-depth look at the actual code that drives the car.

Prerequisites
The tutorial is notintended as an entry point to learning Unity. You should have a basic understanding of how Unity is organized, what a GameObject is, what Components are and so on. Some

3

“The Car Tutorial”― Creating a Racing Game for Unity, Part 1

unity

proficiency in scripting is also recommended. This being said, we will explain a lot of stuff along
the way, basic and advanced.

We will not show
•All the other scripts.



The very basics. We will not go in depth with explaining the basic workflow and components in
Unity. For that there are many other resources available at:
http://unity3d.com/support/documentation/video/
http://unity3d.com/support/resources/

The User Manual and the Scripting Reference are valuable companions as you follow along this
tutorial. We suggest that youvisit these resources when ever you encounter a built in Component
or function that you’d like to know more about.

The approach taken at first is that of code monkey see, code monkey do: You follow the instructions we give about putting a car together and changing it’s variables. Hopefully you will be curious about how it works, learn something from seeing how everything is put together and dosome
investigation on your own. Feel free to explore.

In the last and longest section we dive more deeply into the actual code that makes the car drive.
This is not a line-by-line walkthrough, but we will cover most of what is going on. One way to learn
programming or improve ones skills is to look at a lot of code (supplemented by doing a lot of
programming). We are certain that you willlearn a lot from following this closely and getting an
understanding of how the code works together.

4

“The Car Tutorial”― Creating a Racing Game for Unity, Part 1

unity

Part 1: Assembling the Car
Download the zipped project folder from http://unity3d.com/support/resources/files/CarTutorial.zip
Start by opening the scene named ‘CompleteScene’. This scene has the car already setup,so you
can try it out by pressing the Play button. This will show you the end result of what we are going
to build.

When you are done playing around, open the scene named
‘ TheTrack’. This scene contains what is needed to race, except the
most important part - a car.

Now drag the car model into the Scene. In the Project view you find it under Models/Car/catamount.

Depending on where...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Tutoriales
  • tutorial
  • Tutorial
  • Tutorial
  • Cara a cara
  • tutorial
  • tutorial
  • Tutorial

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS