TouchStarted firing even when player interacts with game UI

Trying to add mobile functionality to a hold and release tool and having issue with touchstarted.

I’m checking for the game processed event, but it still goes through even if I’m interacting with ingame UI.

Video for better explanation.

Essentially just want to be able to move without activating the tool

local function startInput(input,gpe)
	if gpe then return end
	if not Equipped then return end -- If the bow is not equipped, it disables the function
	if not CanUse then return end
	
	local Start = os.clock()
	Event:FireServer(Character, Tool, "Load")
	
	if Zooming then -- Stops other tweenings
		Zooming:Cancel()
		Zooming = nil
	end

	if Connection then -- Checks for connection bugs
		Connection:Disconnect()
		Connection = nil
	end

	local I = TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut, 0, false, 0)
	local G = {FieldOfView = 80}
	Zooming = TweenService:Create(workspace.CurrentCamera, I, G)
	Zooming:Play() -- Zooms out

	Connection = RunService.RenderStepped:Connect(function(Elapsed) -- Will check progress and time elapsed
		if not Equipped then return end
		if os.clock() - Start > 0.01 then
			if Progress < 100 then
				Progress = Progress + 1
				Start = os.clock()
			elseif Progress < 0 then
				Progress = 0
			end
		end
	end)
end
1 Like

Can you show the code so we have more information?

3 Likes

Added code

1 Like

Hm, maybe that is not considered part of the game UI.

1 Like

well what would be the solution

1 Like

Does the tool.Activated event fix this? I don’t know since I rarely use it, but it may be worth trying because I can’t check myself right now.

1 Like

Did you try inverting the gameProcessed? That is to say, check if it’s false, instead of true?

1 Like

Word… i dont know how i missed that reading over his code lol

I didn’t even read the code, lol, it was just an experienced based guess. I’ve had the same issue before

1 Like

It wouldn’t work considering that touches outside of UI also come as false. Would essentially just make it not function