MouseButton1Click doesn't work for mobile

Trying to make a tween a frame, but it only works for pc and not mobile, I thought mousebutton1click could go for both devices.
image
Any help is appreciated!

3 Likes

You can always try button.Activated:Connect(function()

3 Likes

Does not work, the problem is some of the buttons work but others won’t and its confusing me.
I’ve tried restarting studio several times because i know it should be working but its still not.

I’m sure you’ll find great help in here.

That must be a problem with the script then.

Activated is basically the same as MouseButton1Click, but it also supports Mobile and possibly Xbox but I’ve never looked into it.

Also, @ShutzCh he doesn’t want to create Mobile buttons, those only appear on Mobile. He wants to fix his existing buttons to also support mobile.

Instead of “MouseButton1Click” try “Touched” for it to work on mobile

doesn’t seem to be working either could it be that the button has too many parents? image
the close button won’t work but if i place it in other ScreenGuis it does work why is it so?

@KdudeDev is right!
Im 100% sure MouseButton1Click works for PC and Mobile. It’s surely problems with ur script.
And probably that huge Parents ladders is hidding a problem.
I totally avoid to do that. Seems like a powerful light to atract bugs.
Maybe its related with that behaiour, “if I place the close button in other Guis it does work”

I would recommend, delete all those Parents, move the script, higher in the hierarchy, and organize stuff better.
Also, do a quick test, with only a button inside a frame, for you to check that MouseButton1Click works perfect for both PC and Mobile.

2 Likes

Its not Touched, its Activated. Here is the page for it to prove its real:

Also @Dev_Peashie MouseButton1Click only works on PC, Activated works on both.
The parenting system should cause no bugs, as long as he is using it right in the script.

1 Like

Sorry, then Im doing something wrong. Cause I only use MouseButton1Click on all my GUI’s. I only play on PC, my best Friend only play on Mobile, and everything works perfect always…
So maybe Im doing something wrong that makes it always to work fine.

EDIT:About the Parenting. I disagree. I know it doesnt cause bugs by itself. Depends on the person who scripted that, being very careful to not miss that ladder… for readability its a very bad idea when you can just simply be well organized.

2 Likes

I am not pretty sure if it actually works, but there is a TouchTap event…

Well, its probably a studio bug I had to change the name of the ScreenGui, even though it wasn’t affected by anything. I’ll have to change the name of it in every script and it’s tiring.

Yep, agreed. Just tested, use MouseButton1Click for all my guis, tested it on mobile, it worked, no issues. The activator is not the error.

1 Like

Hey, what’s that code making the button invisible for mobile doing there? Unsure, but, I think code stops when it’s parent is a gui and set visible to false.

1 Like

Actually its for both and there is no script that makes the button not visible and the script is enabled too, there seems to be nothing affecting it other than changing the name of the screengui which I think is weird and is probably a studio bug as i said before.

Are you telling me you tested one in mobile engine, and one in computer studio engine? You should try computer engine and mobile engine, not just studio vs mobile. This could’ve really helped you notice it as a studio bug instead. Studio doesn’t always work the same as the roblox engine.

Yep I tried the engine and even updated and test with a mobile phone. and it didn’t change results.
I am as confused as you are.

Then I don’t see how this was a studio bug. Probably the name conflicted with other code specifically for mobile. I don’t know.

As I said earlier there are no scripts I’ve noticed that affected it, no script makes the button invisible, no script makes the localscript in the button disabled and there were no errors.

Did you check for errors when on mobile with /console?