function CameraModule.OnCameraSubjectChanged(O)local m=workspace.CurrentCamera local e=m and m.CameraSubject if O.activeTransparencyController then O.activeTransparencyController:SetSubject(e)end if O.activeOcclusionModule then O.activeOcclusionModule:OnCameraSubjectChanged(e)end O:ActivateCameraController(nil,m.CameraType)end function CameraModule.OnCameraTypeChanged(m,O)if O==Enum.CameraType.Scriptable then if UserInputService.MouseBehavior==Enum.MouseBehavior.LockCenter then UserInputService.MouseBehavior=Enum.MouseBehavior.Default end end m:ActivateCameraController(nil,O)end
-- Note: The active transparency controller could be made to listen for this event itself.
function CameraModule:OnCameraSubjectChanged()
	local camera = workspace.CurrentCamera
	local cameraSubject = camera and camera.CameraSubject

	if self.activeTransparencyController then
		self.activeTransparencyController:SetSubject(cameraSubject)
	end

	if self.activeOcclusionModule then
		self.activeOcclusionModule:OnCameraSubjectChanged(cameraSubject)
	end

	self:ActivateCameraController(nil, camera.CameraType)
end

function CameraModule:OnCameraTypeChanged(newCameraType)
	if newCameraType == Enum.CameraType.Scriptable then
		if UserInputService.MouseBehavior == Enum.MouseBehavior.LockCenter then
			UserInputService.MouseBehavior = Enum.MouseBehavior.Default
		end
	end

	-- Forward the change to ActivateCameraController to handle
	self:ActivateCameraController(nil, newCameraType)
end
