function CameraModule.GetCameraControlChoice(d)local M=Players.LocalPlayer if M then if d.lastInputType==Enum.UserInputType.Touch or UserInputService.TouchEnabled then if M.DevTouchCameraMode==Enum.DevTouchCameraMovementMode.UserChoice then return CameraUtils.ConvertCameraModeEnumToStandard(UserGameSettings.TouchCameraMovementMode)else return CameraUtils.ConvertCameraModeEnumToStandard(M.DevTouchCameraMode)end else if M.DevComputerCameraMode==Enum.DevComputerCameraMovementMode.UserChoice then local d=CameraUtils.ConvertCameraModeEnumToStandard(UserGameSettings.ComputerCameraMovementMode)return CameraUtils.ConvertCameraModeEnumToStandard(d)else return CameraUtils.ConvertCameraModeEnumToStandard(M.DevComputerCameraMode)end end end end function CameraModule.OnCharacterAdded(b,d,M)if b.activeOcclusionModule then b.activeOcclusionModule:CharacterAdded(d,M)end end function CameraModule.OnCharacterRemoving(b,d,M)if b.activeOcclusionModule then b.activeOcclusionModule:CharacterRemoving(d,M)end end function CameraModule.OnPlayerAdded(M,d)d.CharacterAdded:Connect(function(b)M:OnCharacterAdded(b,d)end)d.CharacterRemoving:Connect(function(b)M:OnCharacterRemoving(b,d)end)end function CameraModule.OnMouseLockToggled(d)if d.activeMouseLockController then local M=d.activeMouseLockController:GetIsMouseLocked()local b=d.activeMouseLockController:GetMouseLockOffset()if d.activeCameraController then d.activeCameraController:SetIsMouseLocked(M)d.activeCameraController:SetMouseLockOffset(b)end end end return CameraModule.new()

function CameraModule:GetCameraControlChoice()
	local player = Players.LocalPlayer
	
	if player then
		if self.lastInputType == Enum.UserInputType.Touch or UserInputService.TouchEnabled then
			-- Touch			
			if player.DevTouchCameraMode == Enum.DevTouchCameraMovementMode.UserChoice then
				return CameraUtils.ConvertCameraModeEnumToStandard( UserGameSettings.TouchCameraMovementMode )
			else
				return CameraUtils.ConvertCameraModeEnumToStandard( player.DevTouchCameraMode )
			end
		else
			-- Computer
			if player.DevComputerCameraMode == Enum.DevComputerCameraMovementMode.UserChoice then
				local computerMovementMode = CameraUtils.ConvertCameraModeEnumToStandard(UserGameSettings.ComputerCameraMovementMode)
				return CameraUtils.ConvertCameraModeEnumToStandard(computerMovementMode)
			else
				return CameraUtils.ConvertCameraModeEnumToStandard(player.DevComputerCameraMode)
			end
		end
	end
end


function CameraModule:OnCharacterAdded(char, player)
	if self.activeOcclusionModule then
		self.activeOcclusionModule:CharacterAdded(char, player)
	end
end

function CameraModule:OnCharacterRemoving(char, player)
	if self.activeOcclusionModule then
		self.activeOcclusionModule:CharacterRemoving(char, player)
	end
end

function CameraModule:OnPlayerAdded(player)
	player.CharacterAdded:Connect(function(char)
		self:OnCharacterAdded(char, player)
	end)
	player.CharacterRemoving:Connect(function(char)
		self:OnCharacterRemoving(char, player)
	end)
end

function CameraModule:OnMouseLockToggled()
	if self.activeMouseLockController then
		local mouseLocked = self.activeMouseLockController:GetIsMouseLocked()
		local mouseLockOffset = self.activeMouseLockController:GetMouseLockOffset()
		if self.activeCameraController then
			self.activeCameraController:SetIsMouseLocked(mouseLocked)
			self.activeCameraController:SetMouseLockOffset(mouseLockOffset)
		end
	end
end



return CameraModule.new()
