Unity 5 Car WheelCollider Acceleration Issue

Recently I needed to make a small car game for a school project. However, after I setup the car and my simple car control script, the car drives fine, but keeps on accelerating after I release the up arrow key and keeps on slowing down after I release the down arrow key. How do I make it so that the car only accelerates only when the key is pressed down? I have tried to change the gravity and sensitivity in the InputManager, but it doesn’t work.
#pragma strict

var wheelFL : WheelCollider;
var wheelFR : WheelCollider;
var wheelRL : WheelCollider;
var wheelRR : WheelCollider;
var steeringAngle : float;
var throttle : float;
var maxTorque : float;

var speed : float;

function Start () {


function Update () {

throttle = Input.GetAxis("Vertical") * maxTorque;
wheelRL.motorTorque = throttle;
wheelRR.motorTorque = throttle;

steeringAngle = Input.GetAxis("Horizontal") * 15;
wheelFL.steerAngle = steeringAngle;
wheelFR.steerAngle = steeringAngle;

speed = Mathf.Round(GetComponent.<Rigidbody>().velocity.magnitude * 3.6);


To stop the car you should use brakeTorque instead of negative motorTorque.
I’m not sure why your care keeps on accelerating, probably because you don’t stop the car.
try printing the throttle to the screen and check that it’s a 0 when you release all keys.

Check this link for simple car control: