Answers for "Wheel rotation, what am I doing wrong?"
http://answers.unity.com/questions/1851187/wheel-rotation-what-am-i-doing-wrong.html
The latest answers for the question "Wheel rotation, what am I doing wrong?"Answer by CiberX15
http://answers.unity.com/answers/1851189/view.html
Ok so the problem was my equation was correctly returning the PERCENTAGE of how far I needed to turn, it wasn't returning the degrees of rotation. So all I had to do to make it work seamlessly is multiply the rotation travel distance by 360. So the corrected code is as follows:
public class WheelDebug : MonoBehaviour
{
public float MoveSpeed = 1;
public float Diamiter = 1.41f;
// Update is called once per frame
void Update()
{
float distanceMoved = MoveSpeed * Time.deltaTime;
transform.position += Vector3.forward * distanceMoved;
float circumference = Diamiter * Mathf.PI;
float rotationToTravelDistance = distanceMoved / circumference;
transform.rotation *= Quaternion.Euler(rotationToTravelDistance * 360, 0, 0);
}
}Tue, 27 Jul 2021 01:18:31 GMTCiberX15