I'm trying to implement gear physics using Unity, but I've encountered an issue. I've written the following code for one gear to follow another gear.
Quaternion targetRot = Quaternion.Inverse(Quaternion.Euler(targetGear.RelativeRotation.eulerAngles * ratio));
transform.rotation = _startRotation * targetRot;
If the ratio is not greater than 1, it works smoothly, but when the ratio is greater than 1, the object's right axis rotates by 180 degrees.For example.
When I halve the rotation as in the example, I want the larger gear to make a full rotation. How can I achieve this?