Yes I did, I even looked in the explorer while testing if anything happened to the button or the localscript.
The solution is to use MouseButton1Down.
That doesnât ⌠change anything, all it does is mousebutton1click fires when you press the mouse button and its released, mousebutton1down fires when you press it down.
I know. However it does work. I was doing a gun system today and MouseButton1Click didnât work on phones but MouseButton1Down did. MouseButton1Click wasnât even firing somehow.
Try
MouseClick
or
Touched
Both of those are not for GUIâs.
This thread is also over a month old, however for people that search this in the future:
MouseButton1Click
WILL work for pc, mobile, and xbox. It is an issue with your code if its not detected being clicked.
Hello, I solved this by increasing the ZIndex of my button. It now works fine!
Hello! If anybodyâs still stuck on this, try to increase the ZIndex of the object.
If that doesnât work then another reason might be because you have children in the button.
Try adding a button inside your object and increasing that buttonâs ZIndex, and use that for your MouseButton click event.
Hope this helped!
I changed the Z index and it worked for me!
Also, try .Activated (I donât think you have to but according to roblox MouseButton1Click is deprecated)
Where does it say that MouseButton1Click is deprecated?
https://developer.roblox.com/en-us/api-reference/event/GuiButton/MouseButton1Click
It doesnât say it on the forums, But I feel like .Activated
is more helpful
https://developer.roblox.com/en-us/api-reference/event/GuiButton/Activated
The API isnât super helpful about .Activated but it still works the same!
Okay so after browsing some forums I found out that .Activated is used mainly in scripts that control clicking buttons on mobile devices and MouseButton1Click - mainly for computers, that still doesnât mean that it is better to use .Activated everywhere. Also MouseButton1Click is not deprecated.
- I donât think that it works the same since MouseButton1Click is used specifically for detecting left mouse button click.
What I would suggest you to do if your button script is meant to work differently on computers and mobiles is to use both functions in the same script.
Try a MouseButton1Down
A MouseButton1Down does the same thing as a 1Click, but it works better for mobile.
And a MouseButton1Down function works with both computers and mobile
Iâve already said it here, post 22: