Hello, I am trying to smoothly interpolate the rotation of an object back to 0, but it seems to make a full rotation back instead of the shortest distance. Anyone know what to do about this?
Example:
private IEnumerator Reset()
{
while( thisTransform.rotation.z != 0 )
{
thisTransform.eulerAngles = new Vector3( 38, 0, Mathf.SmoothDamp( thisTransform.eulerAngles.z, 0, ref zVelocity, 0.25f ) );
yield return null;
}
}
This will set it back to zero, but it spirals out of control by taking a full circle around instead of just easing back a bit.