Search Unity

Trouble with rotating wheels...

Discussion in 'Editor & General Support' started by Doleman, Aug 14, 2005.

  1. Doleman

    Doleman

    Joined:
    Aug 12, 2005
    Posts:
    87
    Im having a wierd problem with the wheels of a car :/
    Ive done the model in Cheetah3D and its being imported correctly in Unity
    But when im using the script from the carplayground demo it flips the front tires so there lying on the side...

    The wheels is 2 cylinders rotated +-90 degrees on the z-axis and it seems that its the problem...
    Ive found that its this line that resets the Z-axis to 0, how can do to just adjust the Y-axis?

    frontRightWheel.localRotation = Quaternion.AxisAngle (Vector3.up, m_Steer * Mathf.Deg2Rad);
     
  2. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    The easiest way to fix this is to model your car so that the wheels and the car is rotated exactly like in the car demo.

    The car and wheel z-axis must go forward.

    The wheel x-axis and car x-axis must go to the right, when you view the car from behind.

    I am sure cheetah has some way to change the rotation of the transforms without actually moving the geometry visibly.