TouchSwipe appears to not work?

  1. What do you want to achieve? Keep it simple and clear!
    I want to hide a UI element when the player swipes

  2. What is the issue? Include screenshots / videos if possible!
    TouchSwipe event does not trigger when I swipe the UI element

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I saw an Engine bug report that was solved, so I think it’s a me problem

(Also yes, I tested it on a phone in real life)

The print statment does not print when I swipe the UI element

_UI.MoreInfo.TouchSwipe:Connect(function(dir, num)

	print("test")

	if dir ~= Enum.SwipeDirection.Down and num ~= 1 then return end

	game:GetService("TweenService"):Create(
		_UI.MoreInfo, 
		TweenInfo.new(0.25, Enum.EasingStyle.Sine), 
		{Position = UDim2.fromScale(0,1)}
	):Play()

end)

Below is code from a plain Frame I tested, nothing happened again. (Even on a moblie device)

script.Parent.TouchSwipe:Connect(function()
	
	print("test")
	
	game:GetService("TweenService"):Create(
		script.Parent,
		TweenInfo.new(1),
		{Position = UDim2.fromScale(0,1)}
	):Play()
	
end)

if you try using the device emulator in studio in the Test tab to be on mobile, and you try using your mouse to “swipe” on the ui (hold LMB and move down), does that work and make it print?

I have done that. I also have tested it on a physical device, and it still did not trigger the event.

make sure the Active property is set to true, that might be why it’s not firing those events.

Thank you so much, I had no idea that I needed to enable “Active”.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.