i have a fps game the mobile buttons are broken
screen gui > script and frame
inside frame > img button and text lable > local script (inside img button)
the script
if game:GetService(“TouchInputService”).TouchEnabled == true then
for _,v in pairs(script.Parent:GetChildren()) do
if v.ClassName == “Frame” then
v.Visible = true
end
end
end
the local script
– We must get the UserInputService before we can use it
local UserInputService = game:GetService(“UserInputService”)
– A sample function providing one usage of InputBegan
local function onInputBegan(input, gameProcessed)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
print(“The left mouse button has been pressed!”)
end
end
UserInputService.InputBegan:Connect(onInputBegan)
i used local script from UserInputService