A few questions about Car Controller and Wheel Colliders (268394)

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;
}

1 Answer

1

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

Thanks for the link to the thread. I will start exploring alternatives to wheel colliders in unity =) All car controllers that are in the asset store do not meet my requirements. With their help, do not make a real, working game. They're nothing more than techno-demos (no offense, but that's unfortunately true...). I want to achieve the reference arcade physics as for example in "Underground 2". So I want to make my own controller, which I will use in my game, and maybe sell it in the asset store =)

–