local function o(o,m)if not m then local m=screenSpace.ScreenToWorld(o.Position.X,o.Position.Y,1)local T=game.Workspace.CurrentCamera.CoordinateFrame:vectorToWorldSpace(screenSpace.ScreenToWorld(o.Position.X,o.Position.Y,1))T=game.Workspace.CurrentCamera.CoordinateFrame.p-T local g=screenSpace.ScreenToWorld(o.Position.X,o.Position.Y,50)g=game.Workspace.CurrentCamera.CoordinateFrame:vectorToWorldSpace(g)*-1 if g.magnitude>900 then g=g.unit*900 end local z=Ray.new(T,g)local H,Q=game.Workspace:FindPartOnRay(z,player.Character)if Q then frame(Q)end end end

local function mobileFrame(touch, processed)
	-- Check to see if the touch was on a UI element. If so, we don't want to update anything
	if not processed then
		-- Calculate touch position in world space. Uses Stravant's ScreenSpace Module script
		-- to create a ray from the camera.
		local test = screenSpace.ScreenToWorld(touch.Position.X, touch.Position.Y, 1)
		local nearPos = game.Workspace.CurrentCamera.CoordinateFrame:vectorToWorldSpace(screenSpace.ScreenToWorld(touch.Position.X, touch.Position.Y, 1))
		nearPos = game.Workspace.CurrentCamera.CoordinateFrame.p - nearPos
		local farPos = screenSpace.ScreenToWorld(touch.Position.X, touch.Position.Y,50)
		farPos = game.Workspace.CurrentCamera.CoordinateFrame:vectorToWorldSpace(farPos) * -1
		if farPos.magnitude > 900 then
			farPos = farPos.unit * 900
		end
		local ray = Ray.new(nearPos, farPos)
		local part, pos = game.Workspace:FindPartOnRay(ray, player.Character)

		-- if a position was found on the ray then update the character's rotation
		if pos then
			frame(pos)
		end
	end
end
