Hi all, I'm having some very annoying trouble finding the current distance a WheelCollider is extended.
For instance, a test wheel's max suspension distance is 0.3, and when it is fully compressed some 'value' must be at 0, and at rest that value would sit at something in between.
I've tried getting this by using GetGroundHit(), but it's not giving me the results I'm after as it bases it off world space.
WheelHit hit;
if(wheel.GetGroundHit(out hit))
{
point = (wheel.transform.up * wheel.radius);
float d = wheel.transform.position.y - point.y;
distance = (d / wheel.suspensionDistance) * 2;// multiplier;// + 1;
//scaling and other code goes below
This works for a little bit, as seen by the results below
https://imgur.com/UYrREO0
What I'm now trying to accomplish is a solid axle setup.
![alt text][1]
It is all setup and ready to go, but I'm just needing help from someone who knows a little more about it than me.
Cheers
[1]: /storage/temp/101958-screenshot-31.png
↧