Braketorque isn't showing any effect

I made a “car” (a box) and attached 4 wheelcolliders to it, it accelerates like it should if I add mototorque to the wheels. But it’s doesn’t decelerate.

var maxTorque:float = 600;
var maxBrakeTorque:float = 6000;
...
if(accelerating)
{
leftWheel.motorTorque = maxTorque;
rightWheel.motorTorque = maxTorque;
leftWheel.brakeTorque = 0;
rightWheel.brakeTorque = 0;
rearleftWheel.brakeTorque = 0;
rearrightWheel.brakeTorque = 0;
}
else if(braking)
{
leftWheel.motorTorque = 0;
rightWheel.motorTorque = 0;
rearleftWheel.motorTorque = 0;
rearrightWheel.motorTorque = 0;
leftWheel.brakeTorque = maxBrakeTorque;
rightWheel.brakeTorque = maxBrakeTorque;
rearleftWheel.brakeTorque = maxBrakeTorque;
rearrightWheel.brakeTorque = maxBrakeTorque;
}

If the car is “braking” it doesn’t accelerate anymore, so that’s working, but the speed isn’t dropping at all.

You may need to setup the friction curve: http://unity3d.com/support/documentation/ScriptReference/WheelFrictionCurve.html

Without friction, the wheels will slip on the surface (much like sliding on ice).

Found the problem, I set the braketorque to 0 in an other part of the script. 650 lines of code makes bug finding a bit tedious.