x


How do I make a car in unity?

I've set up a car in unity3d 3.0 following this tutorial really closely http://www.gotow.net/andrew/blog/?page_id=78 and I want to make it go now, but the tutorial sort of assumes I know something about scripting, and really don't know a single thing so I'm pretty stuck...

So if anyone could help me out just setting up some controls to make it drive-able that'd be greatly appreciated!

Please note that I'm completely new to the idea of scripting, sorry!

more ▼

asked Nov 14 '10 at 03:14 PM

Oscar gravatar image

Oscar
1 1 1 1

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

You could use a combination of pre-made scripts that are included in the Unity package. For what I understand, you want to make a Third Person Controller, this can be achieved by adding a movement script to the object and a camera follow script to a camera that will follow your car.

These are two scripts that are already written for you. Open your Unity project, go to "C:\program files\Unity\Editor\Standard packages" and double click the "Character Controller" and the "Scripts" unity packages. This will import the standard scripts into your current Unity project.

Now select the camera you want to follow the car. Go to Component -> Camera Control -> Smooth Follow. This will add the smooth follow script to your camera. Go to the script component and you should see a variable "Target" which is set to "none". Drag your object to this field. Now the script will make sure your camera allways looks at the car and also follows it. You can also adjust some variables like height and distance.

For the movement there's also a standard script called "FPS Input Controller". Select your car you want to move, go to Component -> Character -> FPS Input controller.

When you've added these two scripts you already have a basic Third Person controller.

However, writing your own Third Person Controller script is advised if you want to accomplish a specific effect. Here's a handy link: Third Person Controller. Especially page 4 is probably intereseting for you ;)

hope it works

more ▼

answered Nov 14 '10 at 09:00 PM

Yoerick gravatar image

Yoerick
729 2 5 14

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x5270
x1862
x423
x213

asked: Nov 14 '10 at 03:14 PM

Seen: 4382 times

Last Updated: Nov 14 '10 at 03:53 PM