lap counter

does anyone have a lap counter script(s) for a racing game.
thnx

I don’t have one personally, but this gives a quick how to :

http://answers.unity3d.com/questions/12041/ontriggerenter-exit-at-speed

seems to make sense, hope it helps :slight_smile:

I dont have one too but its easy to do: Cube, set “isTrigger” to true.

Attach this Script to the Cube:

var laps : int = 0;

function Update (){

function OnTriggerEnter(){
laps++;
}

}

put the cube on the start of your track. fini.

Note You’ll get a lap on entering the trigger…you should add checkpoints on your track.