public void OnUpdate() { if (!isRotating) { return; } gameObject.Rotation = Quat.CreateSlerp(startRotation, targetRotation, FrameTime.Delta / rotateTime); if (gameObject.Rotation.Forward.Dot(targetRotation.Forward) > 0.9f) { gameObject.Rotation = targetRotation; onComplete(); isRotating = false; } }