GuiTouchTap

Constructor:

GuiTouchTap(Touch.position)

Description

This event is triggered when the user slightly taps on the touch device.

Parameters

Name Type Description
Touch.position Vector3 Coordinates of touch point

Examples

Add the following client script under ClientfirstLogic. Start the game, and slightly tap on the mobile phone touch device. Observe whether the event is triggered or not.

wait(1)
local uipanel = RWObject.Create("UiPanel") -- create a UiPanel
local uibtn = RWObject.Create("UiButton") -- create a UiButton
uibtn.Parent = uipanel -- set the parent of the created UiButton to the new created UiPanel
local person = Players:GetLocalPlayer() -- retrieve the player
uipanel.Parent = person. GameUI -- Set the parent of the UiPanel as GameUI
uibtn.TouchTap:Connect(function(dir)   -- register the event of clicking for the UiButton
      uibtn.ImageColor = Vector3.New(255,0,0) -- the button turns red
    print("Coordinates of the touch point:" ..tostring(dir))
end)