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