7 Days Ago
I investigated why snowmobiles constantly jitter but modular cars don't. Swapped parts around until I eventually determined that tall vehicles don't jitter, but short ones do. For instance, a modular car with only a flatbed would jitter, but a car with only a cockpit wouldn't, even if it used the flatbed entity script. Swapping the world colliders around made the difference. There are no bounds-based checks for vehicle physics in our code, so I looked at what Unity might set internally based on the collider setup. Rigidbody centre of mass was being set correctly, but we didn't set inertiaTensor. I've set an inertiaTensor here manually based on the one Unity calculated from a taller snowmobile, and it successfully removes the jitter. Ideally, we should do a similar solution for modular cars in case we ever add something like a low open cockpit, but I'll need to come up with a way of getting good inertia tensor values manually.