The rotation could be very quick. It takes lower than a second and for certain not 3 seconds.
Possibly it is higher to do it with out utilizing a coroutine? Or one thing within the IEnumerator
is improper with the time and progress calculation?
public IEnumerator DoRotate(float time)
{
var newRotation = Quaternion.AngleAxis(180, Vector3.up) * rework.rotation;
var progress = 0f;
whereas (progress < 1)
{
progress += Time.deltaTime / time;
rework.rotation = Quaternion.Slerp(rework.rotation, newRotation, progress);
yield return new WaitForEndOfFrame();
}
}
Utilization :
personal void FixedUpdate()
{
if (rotateBackwards)
{
StartCoroutine(DoRotate(3f));
rotateBackwards = false;
}
}