- Home /
Car Front Tires rotation clamped between 270° - 90°
My visual front tires are not rotating properly to my car. Left/Right-turning works, but their local x-axis will clamp around 270° - 90° when the car drives. How do I fix that?
void RotateWheels(){
tireFL.Rotate(wheelFL.rpm*6*Time.deltaTime, 0, 0);
tireFR.Rotate(wheelFR.rpm*6*Time.deltaTime, 0, 0);
tireRL.Rotate(wheelRL.rpm*6*Time.deltaTime, 0, 0);
tireRR.Rotate(wheelRR.rpm*6*Time.deltaTime, 0, 0);
wheelFL.steerAngle = horizontal * maxTurn;
wheelFR.steerAngle = horizontal * maxTurn;
tireFL.localEulerAngles = new Vector3(tireFL.localEulerAngles.x, wheelFL.steerAngle, 0);
tireFR.localEulerAngles = new Vector3(tireFR.localEulerAngles.x, wheelFR.steerAngle, 0);
}
Comment
Your answer
Follow this Question
Related Questions
How Rotate Object To Resemble Spinning? 1 Answer
CAR ROTATING HELP 2 Answers
How to make a steering wheel that rotates when wheels do? 0 Answers