Is there an event similar to .Activated that I can use to tell when a player on a touchscreen device has ceased pressing a gui button?
Do you mean when click gui button if yes use
.Button1Down
I believe this is exactly what you’re looking for:
The UserInputService.TouchEnded event fires when a player on a touchscreen device stops pressing a button.
Example code snippet:
local UserInputService = game:GetService("UserInputService")
function TouchEnded(touch, gameProcessedEvent)
print("Touch ended at "..tostring(touch.Position))
end
UserInputService.TouchEnded:Connect(TouchEnded)
1 Like
Thank you!
But is there a way I can tell if they stopped pressing the button specifically? The player might also be touching the touchscreen in order to move around with the joystick–wouldn’t that also fire TouchEnded?
In that case you would use the InputEnded event for a button.
Example Local Script, located under the button:
local button = script.Parent
button.InputEnded:Connect(function(input)
if input.UserInputTupe == Enum.UserInputType.Touch then
print("A user with a touchscreen device stopped pressing the button")
end
end)
1 Like
THANKS! thats exactly what i was looking for!
1 Like
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.