Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to use TouchSwipe?

I'm not sure how to use TouchSwipe help?

1 answer

✓ Accepted answer

TouchSwipe returns 3 arguments. SwipeDirection, NumberOfTouches and GameProcessedEvent.

SwipeDirection is which way the user swiped (e.g Right, Left, Up, Down, None). NumberOfTouches is how many fingers were held down. GameProcessedEvent returns true if the user swiped in the menu, chat or anything that is handled by the CoreScripts.

This is a simple usage of it:

game:GetService("UserInputService").TouchSwipe:connect(function(swipeDirection, numberOfTouches, GPE)
    if GPE == false then --Code will only run if you didn't swipe in the menu, chat or anything handled by the CoreScripts.
        if swipeDirection == Enum.SwipeDirection.Up then
			print("User swiped up!")
		end
    end
end)

This code is tested and working.

This discussion is preserved as it was. New answers, comments, and votes are closed.