- Home /
How is wheelCollider RPM calculated exactly?
Hi All, Apologies if this has been answered before but i cannot find it anywhere. Does anyone know exactly how the rpm property of the wheelcollider is calculated? Obviously a motorTorque value is applied and then presumably this is used with other factors such as the friction variables, rigidbody.mass, drag etc.. but i cant work out exactly how the rpm figure is arrived at. If anyone can shed any light on this that would be greatly appreciated.
Best Regards, Craig
heeeeeeeeeeEEEEEEEEEELP! or you know you dont have to but it would be nice, up to you though
Wish I knew... I am running into the same problem myself.
Yeah very annoying, ive not worked it out yet. Got to the point where im thinking of ditching Wheel Collider altogether and building something from scratch!
Answer by CraigyP · Feb 27, 2013 at 01:15 PM
For anyone interested, from what i can gather the RPM appears to be updated each frame/update by incrementing itself by the value of wheelcollider.motortorque/wheelcollider.radius/wheelcollider.mass * time.deltaTime (to cancel out effect of framerate on calculated value)
Presumably this is why wheelCollider.mass has to be greater than 0 - to avoid a divide by 0 error when RPM (and possibly other stuff) is calculated by Unity
Just popping off to scream into a pillow for a while