Car Tutorial

Hey,

We’re proud to announce a new Car Tutorial for everyone to check out and hopefully learn a lot from.

This in-depth tutorial will take you through all the necessary steps to create a fun arcade style race car mechanic.

Section 1 - Assembling the Car
How to assemble a Car Prefab from a 3D model, scripts and components.

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

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

The tutorial project also includes a high-end physically accurate and realistic car model. Use this if you want to make more simulation-like games.

We hope you like it!

1 Like

Heya! :O)

COOL :smile:

Edit: Okay, I just played it… And words can’t even describe it’s amazingness!!!

Pretty nice!

I encountered some heavy graphical glitches though. I’m not sure if things are going wrong on my end or if the demo scene is flawed in some way. I’m using Unity Basic, windows 7 32bit, with an intel core 2 duo, an nvidia geforce 9800, and two gigabytes of memory, so no stone-age hardware or anything.

This is my in-editor view of the complete_scene: http://www.synthode.com/webjunk/unity_car_demo_bugs.png

First off, the water’s not rendering properly. It just shows a normal map rendered in screenspace wherever the water plane is visible.

Second, the scene view has two permanent overlayed renders of the terrainmesh on the lefthand side.

Third, the game view has similar problems, but they go away once the game starts.

Here’s the full error text:

screenviewcoord[1] < 0 || screenviewcoord[3] < 0
UnityEngine.Camera:Render()
UnityEngine.Camera:Render()
Generate2DReflection:UpdateReflection() (at Assets\Scripts\CSharpScripts\Generate2DReflection.cs:70)
Generate2DReflection:LateUpdate() (at Assets\Scripts\CSharpScripts\Generate2DReflection.cs:40)

[..\..\Runtime\Camera\CameraUtil.cpp line 37]

thank you :!: :!: :!:

Ooo cool, have to check this out, thankyou :slight_smile:

This is wicked stuff!

No glitches here, and I do have a stone-age hardware (or at least bronze-age: G5, ATI X800). I have Pro, and this tutorial does use some Pro effects, but they should be disabled and not have any effect without Pro. Actually one glitch: the road surface disappears if quality is set to Good, but appears at all other settings.

(Speaking of my stone age hardware, even with the settings maxed and running at my desktop res, it manages 20+ fps. If I lower settings and resolution a fair bit it will go a little over 100fps and doesn’t actually look much worse. So good job optimizing that; I’m sure it’s much faster on a recent machine.)

I poked around a bit and it looks like the SoundToggler script for the tunnel wasn’t finished. I think it was supposed to be something like this:

var fadeTime : float = 1.0;
private var soundScript : SoundController;

function Start () {
	soundScript = FindObjectOfType(SoundController);
}

function OnTriggerEnter () {
	soundScript.ControlSound(true, fadeTime);
}

function OnTriggerExit () {
	soundScript.ControlSound(false, fadeTime);
}

The effect is more audible if you use the tunnel_boost sound instead of the other tunnel sound.

If anyone wants a Pro build to play around with, here is a universal build for Mac. I disabled the performance tweak script because I don’t like the quality going up and down at runtime, so it probably won’t run very well on Intel graphics. Also a Windows build here.

–Eric

Yay, no more vehicle questions in the scripting section asking how to make a car. You guys are the amazingist.

This is awesome. I am really impressed by Unity’s very excellent tutorials which are of such high quality. I’m also really impressed that you guys put so much time and effort into creating these significant projects, with all the content and models and everything, and then release it freely to the public… I know it’s an investment for you in making Unity a more appealing product and that this has definite benefits for future business, but still, it’s very nice to be led through how to build these great projects and it really opens up a whole world of possibilities and new skills. Thanks!

Amazed here too!!
No glitches - i get ~120fps at 1600x1200 with “fantastic setting” (9800GTX). Haven’t seen such professionaly looking/working (car mechanics like) thing on Unity till yet. TOP JOB !!!

Looks good! Definitely one of the better looking car oriented Unity things I’ve seen.

YAHOOO!!! :smile:
Unfortunately, for me, I have to go to work soon and don’t have time to look at it right now. :cry:
Oh well, I’ll have a go later.

I am not going to do car game real soon but ohh 1000 thanks to put such wonderful resources so we can learn a lot ;)…specially me :lol:

Thanks! I wanted to try make a car game :smile:

Thanks, this should be quite helpful.

I too am getting the errors though. The game will play ok, but the scene view and game view goes all screwy for me. Below are a couple of screen grabs.

I am running XP Pro and have an ATI Radeon HD 4850 card. Oh, and I am using the free version of Unity, not Pro.

300497--10661--$cartutglitches2_297.jpg

Hi guys,

Glad most of you are enjoying the new Car Tutorial :wink:

If you’re having any issues with the tutorial please submit a bug report. This includes graphical errors as well as unclear passages in the tutorial itself.

You can do this by going to the Help menu, selecting “Report a Problem”, and filling out the necessary info.

We try to weed out all the glitches before we release something like this, but we’re obviously not perfect. The quicker we get good bug reports in the quicker we can fix the issues.

Thanks!

Having the same problem here. I’ll post a bug report momentarily, with a screen shot of the console.
I wonder if it could be an ATI thing, I just had the driver crash. (HD 2600 PRO)

@Dele: Yep, that’s exactly what I’m getting. It seems that everyone that’s getting the glitches is running Unity Basic, I think.

@aNTeNNa trEE: Submitted a report. :slight_smile:

yeah Im on Pro and it runs perfectly.