function Controle (){
currentSpeed = 2*22/7*wheelRL.radius*wheelRL.rpm*60/1000;
currentSpeed = Mathf.Round(currentSpeed);
if (currentSpeed < topSpeed & currentSpeed > -maxReverseSpeed & !braked){
wheelRR.motorTorque = maxTorque * Input.GetAxis("Vertical");
wheelRL.motorTorque = maxTorque * Input.GetAxis("Vertical");
}
}
else {
wheelRR.motorTorque =0;
wheelRL.motorTorque =0;
}
if (Input.GetButton("Vertical")==false){
wheelRR.brakeTorque = decellarationSpeed;
wheelRL.brakeTorque = decellarationSpeed;
}
Line 8, too many }'s
Then you’ll need another one at the end to close the function block
1 Like