I made a menu for my game, and it has a little icon on the top left corner when pressed, opens a side menu. it works perfectly fine on pc but on mobile it just doesn’t work, I tried detecting if the player is on mobile or pc and disable some functions that I assumed caused the problem, but even after that the problem still persists.
Is there anything I’m doing wrong? Here is my code.
logoButton.MouseButton1Click:Connect(function()
if sba == true then
sba = false
local sbt = tweenService:Create(gui.buttons, TweenInfo.new(0.25, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), {Position = UDim2.new(-0.5,0,0,0)})
local gt = tweenService:Create(gui.UIGradient, TweenInfo.new(0.25, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), {Offset = Vector2.new(-1,0)})
gt:Play()
sbt:Play()
else
sba = true
local sbt = tweenService:Create(gui.buttons, TweenInfo.new(0.25, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), {Position = UDim2.new(0,0,0,0)})
local gt = tweenService:Create(gui.UIGradient, TweenInfo.new(0.25, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), {Offset = Vector2.new(0,0)})
gt:Play()
sbt:Play()
end
end)
if onMobile == false then
logoButton.MouseEnter:Connect(function()
if lbd == true then return end
local hoverTween = tweenService:Create(logoButton, TweenInfo.new(0.2, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), {Size = UDim2.new(0.15,0,0.3,0); Position = UDim2.new(0.001,0,-0.02,0)})
hoverTween:Play()
end)
logoButton.MouseLeave:Connect(function()
if lbd == true then return end
local hoverTween = tweenService:Create(logoButton, TweenInfo.new(0.2, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), {Size = UDim2.new(0.13,0,0.26,0); Position = UDim2.new(0.012, 0,0, 0)})
hoverTween:Play()
end)
logoButton.MouseButton1Down:Connect(function()
lbd = true
local hoverTween = tweenService:Create(logoButton, TweenInfo.new(0.17, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), {Size = UDim2.new(0.13,0,0.26,0); Position = UDim2.new(0.012, 0,0, 0)})
hoverTween:Play()
end)
logoButton.MouseButton1Up:Connect(function()
lbd = false
local hoverTween = tweenService:Create(logoButton, TweenInfo.new(0.17, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), {Size = UDim2.new(0.15,0,0.3,0); Position = UDim2.new(0.001,0,-0.02,0)})
hoverTween:Play()
end)
end