Click not detected

Can you try printing HandleClick() on the mobile touch input function to make sure that HandleClick() fired? It’s supposed to work if HandleClick() fired for both UserInputService functions.

EDIT: So like, do this:

-- For desktop: MouseButton1 click
UserInputService.InputBegan:Connect(function(Input)
	if Input.UserInputType == Enum.UserInputType.MouseButton1 then
		print("ok")
		HandleClick()
	else
		Collect(Input)
	end
end)

-- For mobile: Touch input
if UserInputService.TouchEnabled then
	UserInputService.TouchTap:Connect(function(touchPositions, gameProcessedEvent)
		if not gameProcessedEvent then
			print("ok")
			HandleClick()
		end
	end)
end
1 Like