(Sorry for the repost, title was incorrect)
Hello!
(1) I am here today for I need help with an issue that is preventing me from fully adding mobile support to my game.
(2) The issue I am having is that mobile taps on certain buttons in my game fail to fire the .Activated event.
These same buttons work completely fine on PC. There are a few buttons in my game (simple open/close buttons for certain GUIS) that work completely fine in both mobile/PC. The buttons that are not working are registered, as the button does āgray outā as a button would when tapped/clicked, yet the .Activated event for the said button is not fired on mobile but is fired on PC.
(3) I have looked far and wide for a solution to this issue. I have found nothing, which brings me here.
indent preformatted text by 4 spaces
Here is the code on in a localscript parented to a button that does not work on mobile.
Try replacing āActivatedā with MouseButton1Click. Also is the active property on your button turned on? If itās try turning it off and see if the event works.
I used ContextActionService, so I can bind and unbind action when tool is equipped. Hereās script
local CAS = game:GetService("ContextActionService")
local function toolActivated()
print("Something")
end
script.Parent.Equipped:Connect(function()
CAS:BindAction("ToolActivated", toolActivated, false, Enum.UserInputType.Touch, Enum.UserInputType.MouseButton1)
end)
script.Parent.Unequipped:Connect(function()
CAS:UnbindAction("ToolActivated", toolActivated, false, Enum.UserInputType.Touch, Enum.UserInputType.MouseButton1)
end)
MouseButton1Click does not work. In fact, this bug was the reason I started using .Activated, as I thought MouseButton1Click was the issue. Disabling .Active did not fix the issue
Ok, Iām not sure but all i can think of is using āMouseButton1Upā or āMouseButton1Downā. However, Iām quite sure that MouseButton1Click works for most of mobile.
No, this is for some TextButtons.
The interesting thing is that in some ImageButtons that are completely unrelated to the broken buttons work completely fineā¦
yes thats what iām asking. Do you have multiple buttons parented to it. Or do you have any any gui or frame over the button, with active property set to true?