-- Update the camera with tweening:  (Used instead of Update function when animating between views)

local function UpdateWithTween()
	local duration = (tick() - tweenStart)
	if (duration >= TWEEN_DURATION) then
		duration = TWEEN_DURATION
		CamLock.Update = Update
		tweening = false
	end
	
	local camRotation = GetCameraRotation()
	local tweenAmount = currentView.Ease(duration, 0, 1, TWEEN_DURATION)
	local cf0 = GetViewCFrame(tweenFromView, camRotation)
	local cf1 = GetViewCFrame(currentView, camRotation)
	cam.CFrame = cf0:lerp(cf1, tweenAmount)
	
	-- If you like unreadable code, here's the above chunk (from camRotation) in one step:
	--cam.CFrame = GetViewCFrame(tweenFromView, GetCameraRotation()):lerp(GetViewCFrame(currentView, GetCameraRotation()), currentView.Ease(duration, 0, 1, TWEEN_DURATION))
	
end

