Как-то так:
public class RotateOnce : MonoBehaviour
{
bool _rotating = false;
void Update()
{
if (!_rotating && Input.GetKeyDown(KeyCode.D))
{
StartCoroutine(RotateOnce());
}
}
IEnumerator RotateOnce()
{
_rotating = true;
var oldRotation = transform.rotation;
var newRotation = transform.rotation * Quaternion.Euler(0, 90, 0);
var t = 0f;
while (t < 1)
{
transform.rotation = Quaternion.Slerp(oldRotation, newRotation, t);
yield return null;
t += Time.deltaTime;
}
transform.rotation = newRotation;
_rotating = false;
}
}