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