title: Unity car acceleration problem after brake
body: <p>I have a car physics class which is wheel colliders attached. I've set the &quot;maxMotorTorque&quot; value to 150, &quot;maxSteeringAngle&quot; to 30 and &quot;brake&quot; to 150 on the inspector. This is a simple code I copied from the unity wheel colliders tutorial and I added brake. When I press space key and make the brake active, my car stops but my car is not accelerating again even though I press the &quot;W&quot; and &quot;S&quot; keys. Here is my code:</p>
  <pre><code>using UnityEngine;
  using System.Collections;
  using System.Collections.Generic;
  
  [System.Serializable]
  public class AxleInfo
  {
  public WheelCollider leftWheel;
  public WheelCollider rightWheel;
  public bool motor;
  public bool steering;
  
  
  }
  public class CarPhysic : MonoBehaviour
  {
  public List&lt;AxleInfo&gt; axleInfos;
  public float maxMotorTorque;
  public float maxSteeringAngle;
  public float brake;
  public bool isBraking;
  
  
  
  // finds the corresponding visual wheel
  // correctly applies the transform
  public void ApplyLocalPositionToVisuals(WheelCollider collider)
  {
      if (collider.transform.childCount == 0)
      {
          return;
      }
  
      Transform visualWheel = collider.transform.GetChild(0);
  
      Vector3 position;
      Quaternion rotation;
      collider.GetWorldPose(out position, out rotation);
  
      visualWheel.transform.position = position;
      visualWheel.transform.rotation = rotation;
  }
  
  private void Braking(AxleInfo axleInfo)
  {
      if (isBraking)
      {
          axleInfo.leftWheel.brakeTorque = brake;
          axleInfo.rightWheel.brakeTorque = brake;
      }
      else
      {
          axleInfo.leftWheel.brakeTorque = 0;
          axleInfo.rightWheel.brakeTorque = 0;
          
      }
      
  }
  
  
      public void FixedUpdate()
  {
      float motor = maxMotorTorque * Input.GetAxis(&quot;Vertical&quot;);
      float steering = maxSteeringAngle * Input.GetAxis(&quot;Horizontal&quot;);
  
      foreach (AxleInfo axleInfo in axleInfos)
      {
          if (axleInfo.steering)
          {
              isBraking = false;
              axleInfo.leftWheel.steerAngle = steering;
              axleInfo.rightWheel.steerAngle = steering;
          }
          if (axleInfo.motor)
          {
              isBraking = false;
              axleInfo.leftWheel.motorTorque = motor;
              axleInfo.rightWheel.motorTorque = motor;
          }
          if (Input.GetKey(KeyCode.Space))
          {
              isBraking = true;
              Braking(axleInfo);
          }
          ApplyLocalPositionToVisuals(axleInfo.leftWheel);
          ApplyLocalPositionToVisuals(axleInfo.rightWheel);
      }
  }
  </code></pre>
  <p>}</p>