When the game is tested on Mobile device, the joystick doesnt go over GuiButtons properly, instead is stopping by the start of the button and then appears at the end, check the gif (Left bar buttons)
i fixed it with such a way
repeat wait(0.1) until game:IsLoaded()
local uis = game:GetService('UserInputService')
local buttons = {}
for i,v in pairs(game.Players.LocalPlayer.PlayerGui:WaitForChild('Buttons'):GetChildren()) do
if v:IsA('ImageButton') then
table.insert(buttons,v)
end
end
if not uis.TouchEnabled then return end
local TouchGui = game.Players.LocalPlayer.PlayerGui:WaitForChild('TouchGui')
local ThumbStick = TouchGui.TouchControlFrame.DynamicThumbstickFrame.ThumbstickEnd
print("Player is on mobile")
function active(bool)
for i,v in pairs(buttons) do
v.Active = bool
end
end
ThumbStick.InputBegan:Connect(function()
active(false)
end)
ThumbStick.InputEnded:Connect(function()
active(true)
end)
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.