# How to make traction control for car?

Hello again!

I am trying to do a traction control for my car, that is, when I accelerate suddenly, the RPM goes up faster and the car slides slightly, what I did was modify the wheelcolliders when the gear change is less than 1, but not It convinces me (Rear traction bool = rear wheels acelerate).

``````			if(RearTraction == true && Gear <= 1f)
{
WheelFrictionCurve frictionCurveTI = WheelTI.forwardFriction;
frictionCurveTI.stiffness = TractionStifness;
frictionCurveTI.extremumValue = TractionExtremumValue;
WheelTI.forwardFriction = frictionCurveTI;

WheelFrictionCurve frictionCurveTD = WheelTD.forwardFriction;
frictionCurveTD.stiffness = TractionStifness;
frictionCurveTD.extremumValue = TractionExtremumValue;
WheelTD.forwardFriction = frictionCurveTD;
}else{
WheelFrictionCurve frictionCurveTI = WheelTI.forwardFriction;
frictionCurveTI.stiffness = 0.2f;
frictionCurveTI.extremumValue = 20000f;
WheelTI.forwardFriction = frictionCurveTI;

WheelFrictionCurve frictionCurveTD = WheelTD.forwardFriction;
frictionCurveTD.stiffness = 0.2f;
frictionCurveTD.extremumValue = 20000f;
WheelTD.forwardFriction = frictionCurveTD;
}
``````

I am trying to do something like this (watch the second 0:07): Need For Speed: Carbon - Nissan 240SX - Test Drive Gameplay (HD) [1080p60FPS] - YouTube

Thank you!

if wheels are slipping, reduce the power to wheels quickly… say 10% per frame… until they stop slipping… once they are gripping… start increasing the power again ( but slower, say 5%). this will keep the wheels mostly gripping.
You’ll need to play with the 10% and 5% numbers though… depending on power and gearing of your car, 2wd or 4wd and surface slipperiness. ( you could have different settings for different surfaces, like off road vehicles do)