function ControlModule.OnComputerMovementModeChange(V)local L,B=V:SelectComputerMovementModule()if B then V:SwitchToController(L)end end function ControlModule.OnTouchMovementModeChange(V)local L,B=V:SelectTouchModule()if B then while not V.touchControlFrame do wait()end V:SwitchToController(L)end end function ControlModule.CreateTouchGuiContainer(V)if V.touchGui then V.touchGui:Destroy()end V.touchGui=Instance.new("\083\099\114\101\101\110\071\117\105")V.touchGui.Name="\084\111\117\099\104\071\117\105"V.touchGui.ResetOnSpawn=false V.touchControlFrame=Instance.new("\070\114\097\109\101")V.touchControlFrame.Name="\084\111\117\099\104\067\111\110\116\114\111\108\070\114\097\109\101"V.touchControlFrame.Size=UDim2.new(1,0,1,0)V.touchControlFrame.BackgroundTransparency=1 V.touchControlFrame.Parent=V.touchGui V.touchGui.Parent=V.playerGui end return ControlModule.new()
-- Called when any relevant values of GameSettings or LocalPlayer change, forcing re-evalulation of
-- current control scheme
function ControlModule:OnComputerMovementModeChange()
	local controlModule, success = self:SelectComputerMovementModule()
	if success then
		self:SwitchToController(controlModule)
	end
end

function ControlModule:OnTouchMovementModeChange()
	local touchModule, success = self:SelectTouchModule()
	if success then
		while not self.touchControlFrame do
			wait()
		end
		self:SwitchToController(touchModule)
	end
end

function ControlModule:CreateTouchGuiContainer()
	if self.touchGui then
		self.touchGui:Destroy()
	end

	-- Container for all touch device guis
	self.touchGui = Instance.new("ScreenGui")
	self.touchGui.Name = "TouchGui"
	self.touchGui.ResetOnSpawn = false

	self.touchControlFrame = Instance.new("Frame")
	self.touchControlFrame.Name = "TouchControlFrame"
	self.touchControlFrame.Size = UDim2.new(1, 0, 1, 0)
	self.touchControlFrame.BackgroundTransparency = 1
	self.touchControlFrame.Parent = self.touchGui

	self.touchGui.Parent = self.playerGui
end

return ControlModule.new()
