local R=CFrame.new()function CameraModule.Update(w,C)if w.activeCameraController then if FFlagUserCameraToggle then w.activeCameraController:UpdateMouseBehavior()end local A,E=w.activeCameraController:Update(C)w.activeCameraController:ApplyVRTransform()if w.activeOcclusionModule then A,E=w.activeOcclusionModule:Update(C,A,E)end Players.LocalPlayer.CAM.Value=A local U=A if _G.COFF then local C=_G.COFF or CFrame.new()game.Workspace.CurrentCamera.CFrame=R:lerp(U*C,.4)else workspace.CurrentCamera.CFrame=A end game.Workspace.CurrentCamera.Focus=E R=U if w.activeTransparencyController then w.activeTransparencyController:Update()end end end
--[[
	Main RenderStep Update. The camera controller and occlusion module both have opportunities
	to set and modify (respectively) the CFrame and Focus before it is set once on CurrentCamera.
	The camera and occlusion modules should only return CFrames, not set the CFrame property of
	CurrentCamera directly.
--]]
local last = CFrame.new()
function CameraModule:Update(dt)
	--local Framerate = dt / (1/60)
	if self.activeCameraController then
		if FFlagUserCameraToggle then
			self.activeCameraController:UpdateMouseBehavior()
		end

		local newCameraCFrame, newCameraFocus = self.activeCameraController:Update(dt)
		self.activeCameraController:ApplyVRTransform()
		if self.activeOcclusionModule then
			newCameraCFrame, newCameraFocus = self.activeOcclusionModule:Update(dt, newCameraCFrame, newCameraFocus)
		end

		Players.LocalPlayer.CAM.Value = newCameraCFrame

		local new = newCameraCFrame

		-- Here is where the new CFrame and Focus are set for this render frame
		if _G.COFF then
			local off = _G.COFF or CFrame.new()
			game.Workspace.CurrentCamera.CFrame = last:lerp(new * off, 0.4) --newCameraCFrame
		else
			workspace.CurrentCamera.CFrame = newCameraCFrame
		end
		game.Workspace.CurrentCamera.Focus = newCameraFocus

		last = new

		-- Update to character local transparency as needed based on camera-to-subject distance
		if self.activeTransparencyController then
			self.activeTransparencyController:Update()
		end
	end
end
