This event is triggered when the GUI object is long pressed at the same position.
|Touch.position||Vector3||Coordinates of touch point|
|touchState||Enum.UserInputState||Input type state|
Add the following client script under ClientfirstLogic. Start the game, and long press on the GUI object at the same position on the mobile phone. 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.GuiTouchLongPress:Connect(function(pos,state) -- click the UiButton to trigger the event of mouse long-pressing print("The button is long pressed") print(tostring(pos)) print(tostring(state)) end)