I can't seem to figure out how to set VehicleWheels up to give smooth driving. On a totally flat surface the vehicle bounces around a lot an even flips over once the speed get over about 25 mps. Any suggestions?
Smooth suspension in VehicleBody?
- Edited
That screams to me of an issue with your setup rather than a code problem unless you've done something weird, I remember when playing around with a vehicle controller in Unity and having that issue a lot. Usually what causes a lot of physics weirdness like a rigidbodies flying in the air or flipping the moment you start is there's some sort of overlap happening and yes, this can be the case even if it's overlapping by a miniscule amount, game engines just don't like that and freak out.
Overlapping colliders or wheels? I had overlapping wheels which I suspected so I reduced the number and spread them apart but that made no difference. I have lots of CollisionShapes in the vehicle so maybe some of them are overlapping? Is that what you mean?
I finally got it! Stiffness. I was playing around with decimal points but I found it in the docs and it says <50 offroad, 100+ race car and 200+ for formula 1. I set the wheels to 50 and it's pretty smooth now.
I was mostly playing with damping which did pretty much nothing.
RTFM is best I guess
patm Good that you figured it out yourself, yes, even the slightest bit of overlap if you've got them attached to rigidbodies it's going to cause problems. I'd call it good practice just to make sure even if it is working for now to deal with that problem because if you start driving about and colliding with stuff it will likely come up as an issue in the future. Either that, or put them on separate layers as appropriate to your setup.