.Activated and MouseButton1Click not working for mobile users

Sure, let me just get that ready.

Here’s a screenshot of the hierarchy of PlayerGui. The localscript is where the button controller is.

Testing on computer

With mobile “emulator”:

On my actual phone:

I’ve tried that and nothing was printed.

Try setting the active property for all the UI elements to false

1 Like

I tried it and the same thing happened.

Try creating a new ScreenGUI with a TextButton and the same .Activated event, print anything to see if that event actually works.

1 Like

Yep, creating a new button does activate the .Activated event.

You might wanna try your mute system inside the new ScreenGui to see if that works as well

1 Like

It doesn’t activate in the new ScreenGui.

Do you have any backdoor breaking your scripts?

No, I create all of my scripts from scratch.

Since it’s deprecated, I’m assuming this has something to do with the UICorner instance that you have under the button. This instance is pretty new to Roblox so it might be the case where they forgot to implement it with .Activated, it would explain why MouseButton1Click works as that’s the recommended method of sensing client input on a GUIButton.

1 Like

Yeah, it could be compatibility, however .MouseButton1Click doesn’t work either.

Confused now, If MouseButton1Click isn’t working, its either that the event is getting silenced as in the case when using ContextActionService or your code is never reaching that line that connects the event to a callback.

1 Like

I’m not using CAS, and it works on computer which is weird. I put all the info you asked for in post 16

Full script is in post 4

I see the issue now. It’s most definitely your Z-Index that’s messed up. Try setting the TextButton’s Z-Index to 10. This will make sure that your button isn’t fighting with other elements to be sensed on the screen. The behavior changes with mobile inputs too which would explain why it’s only working on PC.

EDIT: Make sure to mark as solved, when you’ve observed the behavior :slightly_smiling_face:

3 Likes

Yeah I totally agree with what @Zexali said I believe that your script isn’t really reaching the part where it connects into the .Activated event, as you said that it works on other scripts using .Activated

1 Like

I feel so stupid. It finally worked, thank you guys so much!

Basically here’s a summary of what I did (it’s too much lol)
Changed ZIndex
Changed Active to false on labels/frames
Changed Active to true on buttons
Changed Activated to MouseButton1Click

1 Like

Yeah it’s probably the stacking of multiple GUI elements, that sometimes messes up the GUI perspective for touch / mobile. Make sure to mark your post as the solution for other people to advantage of this!

2 Likes

btw it wasn’t necessary to change Activated to MouseButton1Click; @Zexali got the two confused. Activated is the recommended event.

2 Likes

It’s alright, as long as it works. I was getting so frustrated and couldn’t figure out why haha.