car game questions

hello

i am making a racing game after following alot of tutorials and it’s nearly finnished but a still missing a few things

1- i downloaded the prefab in this url
http://forum.unity3d.com/threads/638...eedometer-dial
but i didn’t know how to install it can any one explain to me how to move it and how to connect it with the car

2- how to put a car position in the game

3- how to put lab counter

thank you ^-^

1 Answer

1

Please explain lab counter and car position. Do you mean LAP counter? Do you mean when the car finishes it lists its place?

Lap counter:

var laps = 0;
var pass = 1;
var total = laps + pass;

function OnTriggerEnter () {

laps = laps + pass;

}

function Update () {

Debug.Log("Laps: (total)");

}

Make a cube, Turn off mesh renderer, Make it a trigger, Attach script, Now every lap the cube will count up and display it in the debug log.

Also, I’m not sure where you got the download from in the URL.

Car place:

var place = 1;
var finished = 1;
var otherCar;
var finish;

function OnCollisionEnter (otherCar : finish ) {

place + finished;

}

function Update () {

Debug.Log("Your place is: (+place)")

}


If the script has errors, sorry, I'm still learning as well.