How to detect new Roblox UI or at least force it?

For some reason when I play on my main account I still have the old Roblox ui
IMG_0569
But now if I join on an alt on the same device I get the new UI


This leads me to believe that part of my player base will have the new UI which would be blocking my game’s UI

Of course I plan to remake my UI for the new Roblox one but until then is there a way to detect or at least force the new Roblox UI?

3 Likes

I haven’t tested this in any way, however, you could try GetDescendants() on the PlayerGUI, and those two GUIs should have different descendants so it may be possible to tell apart between the two.

1 Like

Studio only uses the new Roblox ui now so that wouldn’t work to find the other one

1 Like

You could try detecting it with GuiService.TopbarInset

4 Likes

damn it even updates the ui position to be pushed to the right when you open it thats perfect!

To add to this (and fully answer my original question)
You can detect if a player is using the new roblox UI with this line of code

if game.GuiService.TopbarInset.Height > 45 then -- the new roblox ui uses Height == 58

If anybody is interested heres my final script for detecting and adjusting my ui button based on which roblox ui your using

local chat = script.Parent.Parent:WaitForChild("Chat")
task.wait(0.5) -- wait for TopbarInset to get its values for your player's device
if chat then 
	if chat:FindFirstChild("Frame") then
		if chat.Frame:FindFirstChild("ImageButton") then
			script.Parent.TopbarIcon.Size = chat.Frame.ImageButton.Size
			if game.GuiService.TopbarInset.Height > 45 then -- the new roblox ui uses Height == 58
				print("Using new roblox icon ui!")
				game.GuiService:GetPropertyChangedSignal("TopbarInset"):Connect(function() -- animate when it expands
					local inset = game.GuiService.TopbarInset
					script.Parent.TopbarIcon.Position = UDim2.new(0, inset.Min.X+5, 0, inset.Max.Y-script.Parent.TopbarIcon.Size.Y.Offset-3)
				end)
				local inset = game.GuiService.TopbarInset
				script.Parent.TopbarIcon.Position = UDim2.new(0, inset.Min.X+5, 0, inset.Max.Y-script.Parent.TopbarIcon.Size.Y.Offset-3)
			else -- using old roblox ui
				print("Using old roblox icon ui!")
				script.Parent.IgnoreGuiInset = false
				script.Parent.TopbarIcon.Position = UDim2.new(0,103,0,-33)
				script.Parent.TopbarIcon.Size = UDim2.new(0,31,0,32)
				script.Parent.TopbarIcon.IconButton.UICorner.CornerRadius = UDim.new(0.25,0)
				script.Parent.TopbarIcon.IconButton.ImageTransparency = 0.5
			end
		end
	end
end

heres some examples of my ui working with both roblox ui
image

image

4 Likes

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