private void OnTriggerEnter(Collider other) { if (other.GetComponent <CarLaps>()) { CarLaps car = other.GetComponent <CarLaps>(); if (car.checkpoint == cP + 1 || car.checkpoint == cP - 1) { car.checkpoint = cP; Debug.Log(cP); } } }
private void OnTriggerEnter(Collider other) { if (other.GetComponent <CarLaps>()) { CarLaps car = other.GetComponent <CarLaps>(); if (car.checkpoint == lastCheckpoint) { car.checkpoint = 0; car.lap++; Debug.Log(car.lap); } } }
// Start is called before the first frame update void Start() { carlap = GetComponent <CarLaps>(); }