The TouchTap event fires when the player performs a tap gesture on the UI element using a touch-enabled device. A tap is a quick single touch without any movement involved (a longer press would fire
GuiObject/TouchLongPress, and moving during the touch would fire
GuiObject/TouchSwipe). It fires with a table of
DataType/Vector2s that describe the relative positions of the fingers involved in the gesture.
Since this event only requires one finger, this event can be simulated in Studio using the emulator and a mouse. Below is an example of TouchTap being fired on a Frame that is
GuiObject/Active. Below, the event fires when the cursor briefly pauses (to simulate a tap) and the Frame toggles its
GuiObject/BackgroundTransparency. The code for this can be found the code samples.
This event is part of a family of touch-related events. Other events like this one are
Guiobject/TouchLongPress. In addition,
UserInputService has a similarly named event that is not restricted to a specific UI element:
An array of
Tap Transparency Toggle
This code sample will toggle the
GuiObject/BackgroundTransparency of a UI element, like a
Frame, when it is tapped on a touch-enabled device.