Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why does events like MouseButton1Click() and Activated() not work on iPads?

I've had this problem a lot. I've been getting complaints from my game saying that the gui buttons won't work and when I ask them what device they're on they all say iPad. I need help.

Another weird thing is that sometimes the gui does work but for the first few seconds on my game but then they can't tap it at all. This is not because of the scripts, because I tried on my friend's iPad and it did the same thing on every one of my games with gui buttons.

Help?

1 comment

0

uh i have no idea what u talkin bout, my games have textbuttons and i use mousebutton1click and it works for mobile ..

1 answer

MouseButton1Click is most commonly replaced on mobile by TouchTap. You should have your script fire for both, making your game compatible for both mobile and pc. Most people, myself included, forget about TouchTap. I don't know why Activated isn't working, must be an issue with your tool. You script with TouchTap would be the same as MouseButton1Click:

local button = script.Parent --(this example script is in a textButton in a gui)

function buttonPressed()
     --Code
end

button.MouseButton1Click:Connect(buttonPressed)
button.TouchTap:Connect(buttonPressed)

The only solution I can come up with for your error with Activated is that your script ins't reading it correctly:

local tool = script.Parent --(this example script is in a tool)

tool.Activated:Connect(function()
     --Code
end)

I hope this answers your question

3 comments

0

nope touch tap doesnt work as well :(

0

nope touch tap doesnt work as well :(

0

Hmmm...

This discussion is preserved as it was. New answers, comments, and votes are closed.