Hello, I’ve been working on a complete vehicle system for more than a year, but in this period, several doubts have arisen regarding wheel colliders. I’ll list the problems, and if anyone knows how to answer any of them, thank you very much!
1 - What is the ideal value for the ‘ConfigureVehicleSubsteps’ parameter? I read some references, like this: Miscelaneous topics explained - Vehicle Physics Pro
However, I could not come to a very clear conclusion of the best value for the parameter quoted. According to the calculations, the higher the value of the Substeps, the more simulations will be made in relation to the general Physics simulations. But following this principle, if the simulations do not have a big impact, the higher the value, the better.
Currently I am using the values: (1000,20,20), but I do not know if they are the ideals. The best situation is when I use surreal values, such as: (1000,100,100), but I do not know for sure if so many simulations would not have an impact on performance.
2 - When the torque is applied to the wheels, the vehicle always gives a small slip, to leave the inertia; Basically it skids on the wheels that are receiving torque, and this occurs even if I apply the torque with a Lerp. When I tested EDY VEHICLE PHYSICS PRO, I noticed that this does not happen. Some ways to solve this problem are:
- Increase the mass of the wheels to 500
- Decrease Time.fixedDeltaTime to 0.002
- Leave the Substeps of the vehicle at (1000,100,100)
However, none of these solutions seems to be the right thing to do, since the first solution deals with surreal values for the mass of the wheels, and the other two, I believe can affect the performance of the game. So, what should I do to prevent the vehicle from giving this skid when it comes out of inertia?
3 - The simulation of physics occurs at fixed intervals of 50Hz. And that turns out to be a low value for some situations, like when the vehicle goes through a vertical loop. In this situation, the vehicle is usually bouncing because the loop has few triangles in its mesh, and the simulation rate is low for this situation.
One of the solutions we can use to smooth this is to leave the Rigidbody as “Interpolate”. This will smooth the movement but still will not solve the problem of the vehicle bouncing when it goes through the loop. The only way to resolve this problem would be to decrease the value of the variable Time.fixedDeltaTime from 0.02 to 0.01 or some slightly smaller value, but this causes a giant impact on performance.
So the question is: How to prevent the vehicle from jumping in the loop without decreasing the value of Time.fixedDeltaTime?
I still have many doubts, but the ones mentioned above are the main and most urgent ones.