- Home /
Applying proper drag and center of mass for a vehicle
Hi. I'm trying to simulate the physics for a motorcycle with a sidecar. I have all the fundamentals set up -- the wheels, the colliders, the rigidbodies, etc. My problem now is tweaking and getting the proper settings because what happens now is when my tricycle gets a little more faster, it easily flips around.
I'm identifying the problem with the drag and/or the center of mass. I have the center of mass set like the picture below:
I set the mass to 400 kg. For the drag, to simulate the aerodynamics of stuff and not simply have a rigidbody with uniform drag on all sides, I copied the technique used here link text, i.e. using a `Vector3` to simulate drag on the x, y, and z axes. I play with the values of the said `Vector3` but the tricycle still topples over. Is there anything wrong with what I'm doing or should I look at other approaches to solving the problem.
Cheers from the PH! :D
how did you set the mass?
You didn't use rigidbody.mass = 400 did you?
Answer by sparkzbarca · Nov 08, 2012 at 04:22 AM
yea you cant do that. http://docs.unity3d.com/Documentation/ScriptReference/Rigidbody-mass.html
read that and note the mass should be near .01 and NEVER above 10 or you'll freak it out. (it says quote "Large masses make physics calculations unstable".
also note http://docs.unity3d.com/Documentation/Components/class-Rigidbody.html
which says that mass is a number that is arbitrary. Basically while mass is used in the calulations its only important that you get the ratios of mass between objects right.
if your car weights 400kg then set the mass to 4 and make a 100kg object have a mass of 1 and a 10 kg object a mass of .1 etc
Wow. That explains a lot of glitches in the $$anonymous$$atrix. Hehe. O$$anonymous$$, thanks. I'll try it out and let you know how things go.
Your answer
Follow this Question
Related Questions
How to get collisions on Character controller? 1 Answer
OnCollisionEnter isnt called when player lands on object 1 Answer
Rigidbodies won't collide if mass difference is too high 0 Answers
Guidelines for using rigidbody, collider, CharacterControllerScript, etc? 3 Answers
How can i Prevent Kinematic object not to pass through another rigidbody object 1 Answer