function ControlModule.OnComputerMovementModeChange(G)local E,x=G:SelectComputerMovementModule()if x then G:SwitchToController(E)end end function ControlModule.OnTouchMovementModeChange(G)local E,x=G:SelectTouchModule()if x then while not G.touchControlFrame do wait()end G:SwitchToController(E)end end function ControlModule.CreateTouchGuiContainer(G)if G.touchGui then G.touchGui:Destroy()end G.touchGui=Instance.new("\083\099\114\101\101\110\071\117\105")G.touchGui.Name="\084\111\117\099\104\071\117\105"G.touchGui.ResetOnSpawn=false G.touchControlFrame=Instance.new("\070\114\097\109\101")G.touchControlFrame.Name="\084\111\117\099\104\067\111\110\116\114\111\108\070\114\097\109\101"G.touchControlFrame.Size=UDim2.new(1,0,1,0)G.touchControlFrame.BackgroundTransparency=1 G.touchControlFrame.Parent=G.touchGui G.touchGui.Parent=G.playerGui end return ControlModule.new()

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()
