/// <summary> /// used for getting points for lapgates and killing on wall collision /// </summary> /// <param name="other"></param> private void OnTriggerEnter(Collider other) { if (other.gameObject.tag == "wall") { wallHit(); } if (other.gameObject.tag == "lapGate") { if (velocity > 0) { lapGatesPassed++; neuralNetwork.addFitness((10.0f) * lapMultiplier); // add fitness when passing a lapgate lapGateTime = maxLapGateTimer; } } if (other.gameObject.tag == "finishLine") { if (velocity > 0 && lapGatesPassed == 21) { lapGatesPassed = 0; lapMultiplier++; neuralNetwork.addFitness((10.0f) * lapMultiplier); // add fitness when passing a lapgate lapGateTime = maxLapGateTimer; } } }