Rear wheels of car spinning incorrectly

Hello all,

So I’ve been working on a car tutorial and have gotten my vehicle up and running, which is great (I downloaded a free car model from the asset store just to mess around with it and focus on learning some scripting basics). The front wheels rotate in the correct direction, but unfortunately the rear wheels have been exhibiting some erratic behavior. They rotate in the correct direction, but at a faster rate than my front two wheels. I did not follow the Unity car tutorial but another youtube one instead (probably my first mistake) as I didn’t realize that there was a unity-provided one until I started looking for answers to my problem on this site. My car movement script (in c#) is as follows:

using UnityEngine;
using System.Collections;

public class carMover2 : MonoBehaviour {

public WheelCollider wheelFL;
public WheelCollider wheelFR;
public WheelCollider wheelRL;
public WheelCollider wheelRR;

public Transform wheelFLTrans;
public Transform wheelFRTrans;
public Transform wheelRLTrans;
public Transform wheelRRTrans;

public float maxTorque = 50f;
public float turnRadius = 20f;

// Use this for initialization
void Start () {

}

// Update is called once per frame
void FixedUpdate () {

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

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

void Update (){

	wheelFLTrans.Rotate (wheelFL.rpm / 60 * -360 * Time.deltaTime, 0, 0);
	wheelFRTrans.Rotate (wheelFR.rpm / 60 * 360 * Time.deltaTime, 0, 0);
	wheelRLTrans.Rotate (wheelRL.rpm / 60 * -360 * Time.deltaTime, 0, 0);
	wheelRRTrans.Rotate (wheelRR.rpm / 60 * 360 * Time.deltaTime, 0, 0);

}

}

As you can see from the code, it’s currently rear-wheel drive. The front left and rear left tires are at a -360 rotation because when they were duplicated from the right tire, it the model was flipped 180 degrees so that it was facing correctly. The models for the wheels are children of empty game objects, which are used as the wheel transforms. I duplicated the wheel transform game objects and placed them in different empty game objects which are the wheel colliders (the children wheel models were deleted from the wheel collider game objects). The front two wheel transform game objects were duplicated to create the rear wheel ones. I’m wondering if there’s some correlation here as to why the rear tires are spinning at a faster rate and with a ‘jerky’ motion, but I really can’t pinpoint the problem for sure.

Here is the vehicle in wireframe mode which shows the colliders:

And here’s a shot of the hierarchy to give you an idea of how the wheel transforms and wheel colliders are grouped currently:

54765-hierarchy.jpg

Here’s a .gif of how the rear wheels currently move:

The front feels rotate well, and the rear wheels, while rotating in the correct direction. are pretty much on crack. Please let me know if there’s any more info I can provide for you guys! Thanks in advance.

I think it’s due to the 2 -360, when it’s actually played, the left side of the car ( Right side: facing the front ) spins in reverse.

( i would say, do 360 across the board, and just make new wheelColliders and copy-paste the variables )