Wheelcollider Speeding Up on a slope!

Hello everyone. I need some help. I have followed ‘FlatTutorials’ videos on how to make a car game.

Here is the code:

 // If speed limiter is on, disable speed when we hit top speed.
if (currentSpeed >= topSpeed && speedLimited == true && !handbrake){
	wheelRR.motorTorque = 0;
	wheelRL.motorTorque = 0;
}
else if(!handbrake) {
	// This is where the power is applied to the wheels
	wheelRR.motorTorque = engineTorque * Mathf.Clamp(Input.GetAxis("Vertical"),-1,1);
	wheelRL.motorTorque = engineTorque * Mathf.Clamp(Input.GetAxis("Vertical"),-1,1);
	if (!Input.GetAxis("Vertical")){
		wheelRR.brakeTorque = 30;
		wheelRL.brakeTorque = 30;	
	}
	else {
		wheelRR.brakeTorque = 0;
		wheelRL.brakeTorque = 0;
		wheelRR.brakeTorque = brakeTorque * -1 * Mathf.Clamp(Input.GetAxis("Vertical"),-1,0);
		wheelRL.brakeTorque = brakeTorque * -1 * Mathf.Clamp(Input.GetAxis("Vertical"),-1,0);
	}
}

I have a problem though - when I go up slopes, my car speeds up a lot and it’s very unrealistic.

If anyone has a solution I would be very grateful.

Well, lets see pal.

Wheel Colliders are a really complex stuff to mess with. You have Eddy’s package for that matter or the Car Tutorial, try some of these on your “slopes” to see if the problem persists.

A quick fix to this is to think about forces. So, you need to detect when your car is on the “slope” with the rotation component :

    private float SLOPE_LIMIT;
    private float -PARACHUTE;

    void Start(){
        SLOPE_LIMIT=X; // You need to debug and find this number, 
                       // Print or Log values will do or use Debug in the Inspector.
        PARACHUTE=-10000 // Trial and error until you reach the effect.

    }
    void FixedUpdate(){
    if (car.transform.localRotation.x>SLOPE_LIMIT) AddRelativeForce(0,0,-PARACHUTE); 
    }

Im not physx expert or something so enlighten this as you wish.