Enable Roblox Mobile UI

TouchGui didn’t load yet so it prints “TouchGui not found”

2 Likes

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

1 Like

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

1 Like

No, There’s nothing called “TouchGui”

can you send a screen shot of the playerGui when your loaded in using the emulator

1 Like

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()
1 Like

look if theres any scripts that delete any ui

2 Likes

Is there a way to filter through scripts without going through them 1 by 1?


Use robloxs find all / replace all

1 Like

My Roblox Studio looks like this

Nevermind, It’s cause I had the Next Gen Studio UI setting enabled

1 Like

No, Nothing deletes a GUI, I’m not sure why it doesn’t show

I honestly don’t know then. Maybe try to put some scripts into another new place and see if that place has touchUI. and if it doesn’t then try and remove a script at a time to see which one might be effecting it

I’ll copy my Guis into a new place and see if anything happens

1 Like

put this line in command bar:

for _,s in game:GetDescendants() do if s:IsA("Script") or s:IsA("LocalScript") then s.Enabled = false end end
1 Like

I got it fixed, Something was wrong with the PlayerModule.

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