MouseButton1Down not being detected on Mobile in Studio

Issue Type: Other
Impact: Moderate
Frequency: Constantly
Date First Experienced: 2021-05-01 00:05:00 (-05:00)
Date Last Experienced: 2021-05-01 00:05:00 (-05:00)

Reproduction Steps:

  1. Create a ScreenGui

  2. Create a TextButton in the ScreenGui

  3. Create a LocalScript in the TextButton

  4. In the script, write:

     script.Parent.MouseButton1Down:Connect(function()
       print("PRESS")
     end)
    
  5. Enable the mobile device test mode (with any phone)

  6. Play the game

  7. Click on the TextButton

Expected Behavior:
The work “PRESS” should appear in the console.

Actual Behavior:
The click is not detected on mobile. This still works in an actual game though.

Workaround:
Use InputBegan instead.

6 Likes

It is because its a phone, and phones don’t have a mouse.(The original function may work on phones) Use this instead:

script.Parent.TouchTap:Connect(function()
	
end)
2 Likes

MouseButton1Down works in-game, but not in Studio.

4 Likes

if its then how would you make a button work exactly like mousebutton1down on mobile as i also am figuring out how

This is why the specific event is not working. MouseButton1Down receives input through a player’s Mouse (devhub) object in order to fire, and when you’re on a mobile device or emulating one, you will not be sending input via this object but rather through your touch-screen. When you’re emulating mobile, think of your mouse pointer as a simulated fingertip that allows you to send physical touch input to the client - because your code won’t know the difference

If your goal is cross-platform input handling, see GuiObject.InputBegan (devhub) and related members

To add: if MouseButton1Down is fired via touch input on the non-emulated mobile client, then that’s more likely a client bug for mobile and not a studio bug for emulation of mobile.

This has been the functionality since Roblox first debuted on touch devices. The removal of this functionality in the last few days breaks a lot of scripts developed over the last few years in Studio.

5 Likes

Experiencing the same issue, probably a bug unfortunately.

1 Like

This bug started happening for me as well, found it while doing some last-minute update testing. Everything other than MouseButton1Down seems to work fine, and everything still works fine outside studio. It was also just working a few days ago in studio.

I can confirm I am seeing the Same, I know it used to work in Studio, this is how I tested my game for mobile. (example: a drag-able gui button) Now it only works in game.

Thanks for the report! We’ve filed a ticket to our internal database and we’ll follow up when we have an update for you.

5 Likes

Hey! So I’m working on something using .MouseButton1Down right now, I didn’t test in studio, used my own phone to test running OneUI 3 (Samsung Galaxy Note 20 Ultra), didn’t work.

You should use .Activated instead

2 Likes

Yes, this doesn’t work. What I use to workaround it is,

	v.MouseButtonClick:Connect(function()

What’s the status on this?

I’ve been trying to do mobile testing in studio recently and I’ve been unable to click any UI buttons (including roblox core UI) in studio despite it working fine on a mobile device


It appears that only MouseButton1Down is firing, MouseButton1Up and MouseButton1Click is not firing at all

(I am on mac os)

This appears to be due to an input bug with the Mobile Emulator in Studio (at least on macOS) and I have been experiencing it for at least a year now.

Recently, using the Mobile Emulator has been temporarily breaking my mouse input when returning to Edit Mode. I have filed a separate bug report on that:


Do Activated, InputBegan, and InputEnded fire? I have only been able to get InputBegan to fire.

Yeah only InputBegan works for me, it’s kind of similar to how only MouseButton1Down fires as those two events are kind of equivalent to each other.

But yeah this is quite an annoying bug I wish it would get some attention. It’s not dependent on the game or anything I can literally just open a blank baseplate and the bug is still there - no buttons will work.

I don’t know if this happens on EVERY mac os device or perhaps there’s a certain condition that has to be met for the bug to occur and so it only happens to a few of us - that I don’t know. Would be great to see some others test this

1 Like