TextButtons don't work for me on mobile, what's the problem?

  1. What do you want to achieve? I want to print launched when the player taps on the GuiButton

  2. What is the issue? it doesn’t work on mobile studio nor mobile client

  3. What solutions have you tried so far? Trying to see if InputBegan but that doesn’t work either, my friend tried the same code, and it worked for him, but for me it doesn’t. I tried puplishing the game again under a diffrent place but that didn’t work either.

My friend:
image

Button.TouchTap:Connect(function()
	print("Launched")
end)

Button.InputBegan:Connect(function(Input)
	print("KeyCode: " .. tostring(Input.KeyCode))
	print("UserInputType: " .. tostring(Input.UserInputType))
end)
-- Both don't work on mobile for me

Used ButtonDown so you don’t accdiently click while scrolling

2 Likes

You can use .MouseButton1Clicked event since it’s firing both in pc and mobile.

1 Like

As you can see in the code sample section of the developer hub page for TouchTap, the button must have the Active property enabled for it to be able to pick up events.

If Active already is enabled, I’m afraid there’s not much I can do. .MouseButton1Click does also function on mobile devices, although it might not be what you’re looking for.


Edit: Doesn’t it already print?
Image from Gyazo

That doesn’t work for me either on mobile

1 Like


No, that’s my friend

Are you sure there is an issue? I recreated everything in my own place with the same script yet it functions as intended.

Image from Gyazo

Place file: touchpress.rbxl (21.5 KB)

1 Like

I’m not sure what the issue is, but for cross-platform compatibility, use the .Activated event

1 Like

Yes, that is the issue, that it doesn’t work for me but it works for others

1 Like

Still same resault, nothing happens and it doesn’t fire

Button.Activated:Connect(function()
	print("launched")
end)

Show me your console log after testing


My portfoilio.rbxl (33.1 KB)
Script is called: Test Button Script under TextButton, ScrollingFrame, Background, ProfessionalGui, StarterGui

Try using MouseButton1Down

2 Likes

why does that work but nothing else does, not even the touch events :pensive: