Exceeding 5ms Magnitude causes strange random Wheel Collider friction spikes.
Unity 2017.1 Default values.
I was adding wheel slip FX, tyre smoke, skid marks, sound and came across this odd issue which I think is a bug since it starts occurring exactly when the Rigidbody is at 5ms+ which seems like some hard coded internal value.
Nothing I tried would fix it, I believe this is an engine bug.
In the following video pay attention to the ‘Mag’ value when it is above and below 5ms and how the wheel behaves. I added the white bar to the wheel to contrast the wheel pose behaviour so its more visible.
In the top left are wheel slip limit values, they highlight erratic nature of the forward friction.
Its the Vehicles Rigidbody interpolation, it needs to be set at runtime.
We had a similar problem with Ragdolls in another project which we discovered. The ragdolls would have very odd dislocation of joints and the fix was to set the Rigidbody interpolation on in Start() rather than being set in the inspector.
Another follow up, seems to actually be more related to the Wheel mass, I increased the Wheel mass from the default 20 upto 35 and the issue stopped.
The wheels on my Jeep have a radius of 0.6 up from the default of 0.5, I wonder if increasing the radius should imply a heavier wheel which is being factored into the sprung mass calculation?
Looking at the PhysX docs the Wheel Damping Rate is not listed but when configuring the wheel in code there is a value for MOI Moment Of Inertia.
I’ve re-read your post and yes, that issue may surely be resolved with the vehicle substeps:
If I recall correctly, the default parameters are 5, 3, 1. This is why the behavior changes above 5 m/s. Setting the substeps to 5, 3, 3 (assuming 3 is the default substep value, I’m not entirely sure) would give you the same behavior at all speeds.