That might well be a visual effect, where the rotation rate matches the refresh rate. I recommend you to display the rpm of the wheelcolliders on the screen (or better, a graphic showing value vs. time) to verify if there are any actual issues.
That’s an interesting observation. I added Time Scale = 0.1 to the project to see what happens in slow motion.
See for yourself on the video. With Time Scale = 0.1 everything is perfect. No stuttering.
Then I put Time Scale = 0.2. There was a slight stutter. You can see it in the RPMs of the colliders.
But so far, it’s not that critical.
Then I set Time Scale = 0.4. The stuttering is already clearly visible. And the collider RPM is starting to go crazy.
It’s clearly visible at 55 seconds into the video.
What could it have to do with? The closer to time scale = 1, the worse wheelcoliders behave. It feels like Unity doesn’t have time to process wheelcollider physics at time scale = 1. All project settings are default.
Oh, that’s surely that your code handling the WheelColliders is applied from the Update function. When dealing with physics, always use FixedUpdate for calling methods and modifying properties in the physics components or API.
I forgot to clarify that I use PlayMaker for my project. Now I’m trying to figure out if PlayMaker uses the Update or Fixed Update function to write scripts.
I checked the script that makes up PlayMaker. For all physical actions, it uses the Fixed Update function.
I don’t understand why this is happening with Wheel Collider…
The problem with wheel colliders was solved.
It turned out that it was affected by the mass of the wheel colliders. I have a heavy truck (mass 2500). And the colliders had a default mass of 10 kg. The radius of a wheel collider is 0.38, which means the wheel has a diameter of 0.76 meters. That’s a big wheel, and it can’t weigh 10 kilograms.
I set the wheel collider mass to 40 kilograms and everything became perfect.
That’s a good point! Don’t be afraid of increasing the mass to 100 or 200 kg if necessary. This mass doesn’t sum up to the actual vehicle’s weight, but it’s used in the internal calculations. The more mass, the wheel will change its rotation rate slower, which is convenient for numerical stability.