car is pulling to the right!

Hello all,

I’m stuck here…set up my car but it is pulling to the right…anybody ideas!

thanks

After carefully reviewing all of the code you shared with us, I have no suggestions. Sorry.

Can you check is your CenterOfMass object is near to right side of car?

Are you using WheelColliders and moving the vehicle forward by applying torque to the wheels using the motorTorque variable? If so, there are known problems with that method.

I had the same problem. A four wheeled vehicle. All wheels perfectly symmetrical left to right. All four wheels getting exactly the same motorTorque applied. Vehicle running across a perfectly flat plane, and yet it would pull to the right.

I found the problem could be lessened by tweaking your PhysX integration time step and slip factors (see the “A car veers. Physics Issue?” thread). But ultimately, I gave up on using WheelCollider.motorTorque, and instead calculate and apply my own linear force on the vehicle’s rigidbody to move it forward/backward, and apply my own torque to the body to steer it.

I notice that in Unity’s car demo, they do not use motorTorque either, instead calculating their own linear and rotational forces. Which suggests that their demo team knows that motorTorque is broken.

It has been a while since I used wheelcolliders but I believe it has to do with the order you setup the things (or at least that was the case in the olden days).

You have to create all the wheel colliders first before you setup the weight, radius and springs.

Don’t know if the link on http://ctrl-j.com.au/ (JCar Demo) still works, but there you can find my ancient wheel collider demo with code (it’s old, my first attempt of using Unity) and see how I setup the colliders. If the download link doesn’t work, let me know and I’ll dig through my archives :slight_smile:

Mine too, but it will cost $1000 to fix it. They say my Ford Probe has a broken spring in it. (Sorry couldn’t help it! :lol: )

1 Like

Hey! I know this is an old thread but if anyone is stumbling around looking for an answer:
Assuming you’re using +2 wheels (the issue seems to only appear on 2+ wheels) Change the order of when you apply the forces to the wheels. For example I have an AWD car so I apply the forces to the front left first, back right second, front right third and finally the back left. Got the idea from how AUDI actually manages their quattro system so maybe its a genuine real world physics problem too and not a bug ¯_(ツ)_/¯.

Anyway hope that helps anyone wandering through.

Hello it makes sense but how you change the order? They all work on same Update() and at the same time.

I changed my mind and got rid of wheel colliders. I created my own collider system :smile:

Omg man you helped me a lot! Thanks! I have no idea how it works and why but it fixed the issue for me.