void Update() { if (!moveComplete && Vector3.Distance(transform.position, m_TargetCameraState.position) > 0.1f) { // Framerate-independent interpolation // Calculate the lerp amount, such that we get 99% of the way to our target in the specified time positionLerpPct = 1f - Mathf.Exp((Mathf.Log(1f - 0.99f) / positionLerpTime) * Time.deltaTime); var rotationLerpPct = 1f - Mathf.Exp((Mathf.Log(1f - 0.99f) / rotationLerpTime) * Time.deltaTime); traveled += positionLerpPct; m_InterpolatingCameraState.LerpTowardsWithMidpoint(m_TargetCameraState, m_MidPointState, positionLerpPct, rotationLerpPct, traveled); m_InterpolatingCameraState.UpdateTransform(transform); } else if (!moveComplete) { Debug.Log("Move complete"); player.MoveComplete(); moveComplete = true; } }