Hello, I’m not sure why but when I join my game on mobile, The touch ui isn’t there. I was wondering if someone could help me make a script to re-enable it.
maybe this can help you
It didn’t work. I tried putting all the guis into ServerStorage and it still didn’t work.
Use the Roblox mobile emulator and check if “TouchGui” is enabled after you join in. if it isn’t, then that means there’s a script somewhere that disables it directly or through a loop that disables other screenGuis.
It says not found on a mobile device
local UserInputService = game:GetService("UserInputService")
if UserInputService.TouchEnabled then
if game.Players.LocalPlayer.PlayerGui:FindFirstChild("TouchGui") then
print("TouchGui Found!")
else
warn("TouchGui not found!")
end
end
I used the Roblox mobile emulator and “TouchGui” is not in PlayerGui
TouchGui didn’t load yet so it prints “TouchGui not found”
I looked in PlayerGui and TouchGui wasn’t there
then your either deleting it or not using the emulator. Do you maybe have another UI called the same thing. If you do i think that might override it and delete roblox’s
Is the emulator the thing where you can test the game on a phone in roblox studio?
yeah it is. do you maybe have another UI named the same thing
No, There’s nothing called “TouchGui”
can you send a screen shot of the playerGui when your loaded in using the emulator
I don’t know if it works I’ve tried it and it works but I don’t know if it will work for you
local UserInputService = game:GetService("UserInputService")
local Players = game:GetService("Players")
-- Create the TouchGui when the player joins the game
Players.PlayerAdded:Connect(function(player)
-- Check if the player's device is touch-enabled
if UserInputService.TouchEnabled then
-- Create the TouchGui
local TouchGui = Instance.new("ScreenGui")
TouchGui.Name = "TouchGui"
TouchGui.Parent = player.PlayerGui
-- You can add UI elements to the TouchGui here
end
end)
-- Check if the player's device is touch-enabled
local function CheckTouchGui()
-- Get the local player
local player = Players.LocalPlayer
-- Check if the TouchGui is present in the player's GUI
if player.PlayerGui:FindFirstChild("TouchGui") then
print("TouchGui Found!")
else
warn("TouchGui not found!")
end
end
-- Run the function to check the TouchGui
CheckTouchGui()
look if theres any scripts that delete any ui
Is there a way to filter through scripts without going through them 1 by 1?
Nevermind, It’s cause I had the Next Gen Studio UI setting enabled