Script not working on Roblox or Local Server, but works in Roblox Studio

I created GUIs for mobile support in my game, and they work perfectly in Studio. However, when I try them on Roblox or in the Local Server test section within Studio, they don’t work.

I looked at some topics on the Developer Hub to solve the problem, but they didn’t resolve my issue. Also, I should mention that the problem is not related to publishing the game or committing the script.

This is the Local Script in StarterGui

local UIS = game:GetService("UserInputService")
local plr = game.Players.LocalPlayer

if UIS.TouchEnabled then 
	local ui = plr.PlayerGui:WaitForChild("Cat1Gui")
ui.Enabled = true
end

In Studio:

In Local Server/Roblox (they are actually the same :disguised_face:):

Probably because it’s only running once, hook it up to a UserInputService.LastInputTypeChanged event

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.