Car game Reverse Button

Hello!

How do I create a button that, when pressed, makes the car go backwards?

My gas button works like this:

public void Gas ()
		{
				motorInputTouch = 1;
				gasOn = true;
				Debug.Log ("Gas");

				wheelBR.brakeTorque = 0;
				wheelBL.brakeTorque = 0;
		
				// First gear
				if (currentSpeed <= 150 && currentSpeed > -maxReverseSpeed && !braked) {
						wheelBR.motorTorque = OneTorque * motorInputTouch;
						wheelBL.motorTorque = OneTorque * motorInputTouch;
				}
				// Second gear
				else if (currentSpeed <= 300 && currentSpeed > 150 && !braked) {
						wheelBR.motorTorque = TwoTorque * motorInputTouch;
						wheelBL.motorTorque = TwoTorque * motorInputTouch;
				}
		
				// Third gear
				else if (currentSpeed <= 450 && currentSpeed > 300 && !braked) {
						wheelBR.motorTorque = ThreeTorque * motorInputTouch;
						wheelBL.motorTorque = ThreeTorque * motorInputTouch;
				} 
		
				// Fourth gear
				else if (currentSpeed > 450 && currentSpeed <= topSpeed && !braked) {
						wheelBR.motorTorque = FourTorque * motorInputTouch;
						wheelBL.motorTorque = FourTorque * motorInputTouch;
				} else {
						wheelBR.motorTorque = 0;
						wheelBL.motorTorque = 0;
				}
		}

I assume you call Gas() by pressing a button?
You could create a second method called Backwards() getting called when you press another button.

If you want all that in your Gas() method, maybe you could wrap all your gear checks into a if (forward) boolean check. Then there’s the else to do back traveling. Toggle that boolean upon pressing the button.