private void Update() { if (activate_car) { //Give the car a score besed on its local Z velocity and distance from the walls. car_score += body.gameObject.transform.InverseTransformDirection(body.velocity).z *Time.deltaTime; if (car_ai) { car_ai.GetNetwork().SetNetworkScore(car_score); } } }