GuiButton.Activated's clickCount does not work properly on touch and controller

When connecting to a GuiButton.Activated event, the clickCount parameter passed to the callback should represent the number of consecutive clicks on the respective button.

This is useful for detecting double clicks and anything of the sort, but this parameter is always 0 when using touch inputs (like on mobile and tablet) or a controller.

Here is a simple script to demonstrate this behavior, including a video of each of the input methods:

button.Activated:Connect(function(inputObject, clickCount)
	print("Activated! Click count:", clickCount)
end)

Touch input

I have tested this on a phone as well, and the behavior is the same as in the Studio emulator.

Controller input

The same behavior happens with the virtual mouse cursor disabled.

System information

OS: Windows 10 (Version 10.0.19045 Build 19045)
CPU: AMD Ryzen 7 5800X 8-Core Processor
RAM: 32GB
GPU: NVIDIA GeForce GTX 1060 6GB

Place file

This is the place I tested in:
GuiButtonActivatedIssue.rbxl (41.6 KB)

Expected behavior

The mouse input presents the correct behavior, with the clickCount increasing as the button is clicked, and going back to 0 after a certain amount of time passes with no clicks:

4 Likes

Workaround:

Add int value to Starter Gui.

button.Activated:Connect(function(inputObject)
script.Parent.Value.Value += 1
	print("Activated! Click count:", script.Parent.Value.Value)
end)

Thanks for reporting this. A ticket has been filed to our internal database.

2 Likes

We have implemented a solution for this, although I can’t give a precise time this feature will ship. We will update this thread when it goes live so folks can try it out and let us know if this seems to be working for them. Thanks for the report, it helps us make Roblox better!

1 Like

Hey everyone, is everything working here now?