Why is my mute music mutton only working on pc and not mobile?

Hi, I have a mute music script it works fine (Mutes and unmutes) but on mobile it only mutes and does not unmute here is my script (Local Script)

local button = script.Parent

local soundGroup = workspace:WaitForChild('SoundGroup')

local toggle = false

local function click()

if toggle == false then

soundGroup.Volume = 0

else

soundGroup.Volume = 6.5

end

toggle = not toggle

end

button.TouchTap:Connect(click)

button.MouseButton1Click:Connect(click)

Thanks.

i think it may be roblox’s bug?

1 Like

the only thing I can think of would be that the gui button is slightly off-screen on mobile, that sometimes messes it up

1 Like

try to remove button.TouchTap function and then test it

2 Likes

I adjusted the positioning and removed the touchtap function now it works tysm

I’m Glad That I Helped. Feel Free To Dm Me Anytime :heart:

1 Like