- Home /
Applying Torque to wheelcollider
Hey, i'm attempting to apply torque to a wheelcollider using its motortorque in a semi-realistic way:
Basically i'm building a motor for a car that uses specs from any given car, this isnt so much a direct programming question, but more a mechanical engineering one:
I have the Maximum Engine Revs, Kilowatts and Torque (Nm) and i'm attempting to transpose these specs to the wheelcollider.motortorque. My motor currently revs, shifts gears at the maximum revs and works, but the relationship to the torque of the wheel is wrong.
wc.collide.motorTorque = ((powerkW * 5252 * 50)/ currentRPM) * 1/(currentGear)
As you can see the equation is fairly arbitrary and doesnt properly reflect any real simulation.
I know there is a CarTutorial project available, but the tutorial isn't realistic and doesn't apply force to wheelcolliders but to the rigidbody itself.
Can anyone point me in the right direction, or clarify a few things (abit of a mech-eng noob).
Thanks!
Dude, the "wheel collider" really does not work like that. It's a very confusing component -- it's not really a 'wheel" it's more of just a kind of stick that helps the car bounce up and down. they SHOULD HAVE NA$$anonymous$$ED IT something like "suspension collider" or "vehicle corner height adjustor" or something. it is badly named. what you say about the car tutorial is exactly correct - that is how it is done. if you can engineer BETTER EQUATIONS for the physics of car engineering, that is great - go for it. be sure to also look at Unity's "better" car physics example in the car island example project. Also, buy yourself the various "car packages" available on the asset store, to see what they do. (they're all a shambles, but will give you some tips). finally do not hesitate to SI$$anonymous$$PLY NOT USE the strange "wheel collider" components, if you don't want to. I would say many if not most unity vehicle games in the store do NOT use the wheel colliders, people just did it themselves from scratch.
Answer by RubbaKeys16k · Apr 22, 2012 at 03:47 PM
If you would like to know how wheel Colliders really work, in that unlike the comment from Fattie they not only apply suspension but also apply drive and braking, then take a look at something like this: http://carpe.com.au/slawia/2009/08/unity-wheel-collider-part-2/
Your answer
Follow this Question
Related Questions
Unity 5 wheel collider throttle "stuck". 1 Answer
How is wheelCollider RPM calculated exactly? 1 Answer
Best wheel collider values (forward friction,sidewards friction) for racing cars ? 1 Answer
Add Force or Motor Torque .. Which is better for creating a car? 1 Answer
Cube colliders and cars 1 Answer