- Home /
Question by
Reeceg · Feb 06, 2015 at 01:35 AM ·
rotationwheelcollider
WheelCollider.steerAngle match GameObject rotation
How would I get a GameObject to match the steerAngle of a wheel collider.
Comment
Best Answer
Answer by HappyLDE · Mar 21, 2015 at 10:59 PM
It is shown in the unity vehicle package example in unity 5:
for (int i = 0; i < 4; i++)
{
Quaternion quat;
Vector3 position;
m_WheelColliders[i].GetWorldPose(out position, out quat);
m_WheelMeshes[i].transform.position = position;
m_WheelMeshes[i].transform.rotation = quat;
}
However with this approach my meshes are all facing the same direction although in the example they work fine :s
I found the solution for the orientation of the tires all facing the same axis. You need to export both the tires on the lef and the ones on the right.