Finished all cars, and took lap times on them all

This commit is contained in:
magn9775
2024-04-24 10:47:29 +02:00
parent e5ca63e64b
commit 31d0d32aa9
18 changed files with 3604 additions and 751 deletions

View File

@@ -0,0 +1,32 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class LapTimer : MonoBehaviour
{
public float time = 0;
private bool startTime = false;
private void OnTriggerEnter(Collider other) {
if (startTime)
{
startTime = false;
print(time);
} else {
startTime = true;
time=0;
}
}
void FixedUpdate()
{
time +=1;
}
}