A few questions about Car Controller and Wheel Colliders

Hi! I am writing my own car controller. And ran into a few issues with the unity physics engine. An example of these issues is shown in the attached video.


**I will briefly describe the problems.**
  • The lack of stabilization of the movement of the car. With standard values of stiffness (1) on wheel colliders, the car is not able to go straight, but constantly goes into a skid. And vice versa, with a high stiffness value (3), the car stops skidding altogether.
  • Torque is no longer supplied to the wheels when a larger drift angle is reached, which makes it impossible to make “donuts” (but that may not be the cause of the problem).

I tried many options for solving these problems, and so far I have settled on a not quite right, but somehow working solution.
I added a function to change the stiffness, depending on the angle of skidding and wheel slip. But it doesn’t seem right to do so…


Based on this, I have a few questions:

  • How to forward stabilization?
  • How to sideways stabilization?
  • How to car “donuts”?

In the last part of the video, I show an example of what I would like to achieve in my controller.
Can anyone suggest something…

Torque transfer code:

foreach (WheelCollider wheelCol in motorWheels)
{
    wheelCol.motorTorque = (torque / motorWheels.Count) * verticalInput;
}

Unfortunately, Unity WheelColliders are mostly nonsensical, and typically you can achieve some results through trial and error, as you have already done.

However, I can still respond to your questions. In the last part of your video, you showcase a game that utilizes my package, Edy’s Vehicle Physics, for its vehicles. This package provides a vehicle controller component to configure the vehicles in a variety of situations, including donuts, stabilization at high speed, etc.

Therefore, the best advice I can offer is to use a vehicle simulation package from the Asset Store. Explore the available packages, experiment with them, and select the one that best suits your project, whether it’s one of my packages or someone else’s. This approach will save you from a lot of headaches and frustrations.

Here’s a forum post summarizing all that we currently know about Unity’s WheelCollider, in case you’re interested: https://forum.unity.com/threads/can-anyone-point-me-to-some-resources-that-go-into-the-maths-of-what-asymptote-and-extremum-are.947193/#post-6179013