function ControlModule.OnComputerMovementModeChange(z)local j,I=z:SelectComputerMovementModule()if I then z:SwitchToController(j)end end function ControlModule.OnTouchMovementModeChange(z)local j,I=z:SelectTouchModule()if I then while not z.touchControlFrame do wait()end z:SwitchToController(j)end end function ControlModule.CreateTouchGuiContainer(z)if z.touchGui then z.touchGui:Destroy()end z.touchGui=Instance.new("\083\099\114\101\101\110\071\117\105")z.touchGui.Name="\084\111\117\099\104\071\117\105"z.touchGui.ResetOnSpawn=false z.touchGui.Enabled=z.humanoid~=nil z.touchControlFrame=Instance.new("\070\114\097\109\101")z.touchControlFrame.Name="\084\111\117\099\104\067\111\110\116\114\111\108\070\114\097\109\101"z.touchControlFrame.Size=UDim2.new(1,0,1,0)z.touchControlFrame.BackgroundTransparency=1 z.touchControlFrame.Parent=z.touchGui z.touchGui.Parent=z.playerGui end function ControlModule.GetClickToMoveController(z)if not z.controllers[ClickToMove]then z.controllers[ClickToMove]=ClickToMove.new(CONTROL_ACTION_PRIORITY)end return z.controllers[ClickToMove]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.touchGui.Enabled = self.humanoid ~= nil

	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

function ControlModule:GetClickToMoveController()
	if not self.controllers[ClickToMove] then
		self.controllers[ClickToMove] = ClickToMove.new(CONTROL_ACTION_PRIORITY)
	end
	return self.controllers[ClickToMove]
end

return ControlModule.new()
