roblox-ui
Use when building, fixing or reviewing Roblox UI: HUDs, menus, shops, safe areas, scaling, gamepad focus, phone, tablet, console and TV.
How do I install this agent skill?
npx skills add https://github.com/tabooharmony/roblox-brain --skill roblox-uiIs this agent skill safe to install?
- Gen Agent Trust Hubpass
The skill provides comprehensive guidelines for developing Roblox user interfaces, including best practices for mobile responsiveness, gamepad navigation, and performance. It includes security-conscious recommendations for handling player-provided text.
- Socketpass
No alerts
- Snykwarn
Risk: MEDIUM · 1 issue
What does this agent skill do?
Roblox UI
Scope
Any Roblox screen, world or menu UI: placement, scaling, layering, gamepad focus, UI effects. Touch/gamepad bindings and on-screen action buttons: roblox-input; UI cost: roblox-performance; player text and translation: roblox-text.
"Field-measured" = measured in one of the owner's projects; verify on your content. Platform values (insets, top bar, hotbar, console rules) are as of 2026-11.
Traps and review checklist (symptom -> cause -> fix)
- Cut off / offset on a notched phone -> a ScreenGui's canvas is smaller than the screen: even with
IgnoreGuiInset = trueit defaults toScreenInsets = DeviceSafeInsets(780×360 phone -> 685×338 canvas, field-measured). Lay out on the ScreenGui'sAbsoluteSize; interactive UI inCoreUISafeInsets; crosshair and backgrounds in their own ScreenGui withNone(§1). - Overlap maths off by the top bar ->
AbsolutePositionis measured from below the top-bar inset in every ScreenGui, whateverIgnoreGuiInsetsays. Screen Y =AbsolutePosition.Y + GuiService:GetGuiInset().Y; compare across ScreenGuis in rawAbsolutePosition(Studio-measured). - Top-centre pill off-centre ->
TopbarSafeInsetsis lopsided (a centred pill sat at 63% of width). Place byGuiService.TopbarInset, which changes at runtime (§1). - Button under the thumb -> lower-left is the thumbstick zone, jump bottom-right, Roblox menu/chat top-left; top-centre is usually free. Place custom touch buttons from the live jump button in
PlayerGui.TouchGui(§1). - Overlaps only in play -> overlap comes from state pairs (weapon button + round menu, spectate bar + hotbar, toast + timer). Check every pair that can show together on the smallest phone with touch controls up.
- Text tiny on PC / huge on phone under a
UIScalestage ->UITextSizeConstraintcaps are screen pixels and ignoreUIScale(field-measured, two projects). Scale caps with the stage or drop the constraint.TextScaledstops at 100 px. - Whole screen soft/blurry -> it lives in a
CanvasGroup, whose texture resolution the quality level caps. Keep screens in a plainFrame; reparent into aCanvasGrouponly for the fade (field-measured). AUIGradienton aCanvasGrouptints everything inside. - Controller stuck, or focus jumps to the HUD behind a menu -> no
SelectionGroupboundary (defaultSelectionBehaviorisEscape), entry focus on a hidden button, or a top-bar library binding D-pad Up (§2). - Jump/attack dead after closing a menu on gamepad ->
GuiService.SelectedObjectstill set, so gamepad buttons drive UI. Clear it on close; gate gameplay input on it. - Mobile players in portrait in a landscape game ->
StarterGui.ScreenOrientationdefaults toSensor(portrait allowed). SetLandscapeSensorin every place's StarterGui (lobby, stages); it only applies on join, so setPlayerGui.ScreenOrientationfor players already in. - 4th+ tool missing on phones, 11th+ unreachable on PC -> the default hotbar shows 10 slots on desktop but only 3 on touch devices (iPhone 13 and iPad 10th gen, both landscape; set at spawn by touch input, not screen width; Studio-verified 2026-11-29), and keys 1-9, 0 reach only 10. For 4+ tools on mobile or 10+ anywhere disable
Enum.CoreGuiType.Backpack(StarterGui:SetCoreGuiEnabled) and build a hotbar + bag; phones need tap-to-pick from a list (field case). - Console detected wrong ->
GuiService:IsTenFootInterface()is deprecated and hardcodedtrueon consoles. Layout:ViewportDisplaySize == Enum.DisplaySize.Large; controls:UserInputService.PreferredInput. TV: inset from every edge (overscan), no chat window, remote = D-pad + centre (ButtonA) + back (ButtonB). - Menu opens twice / reopens blank -> a stale close tween's
Completedran after reopen. One controller per window, every open path through it, a token that cancels stale tweens, undo list for outside changes (hidden HUD,TouchControlsEnabled, mouse) run on close, destroy and respawn. Leak test: descendants back to baseline after 10 open/close cycles, including close mid-tween. - Outside-click closes the menu when clicking inside -> a plain
Framepasses input.Active = trueon the panel, panel above the close button. - List opens scrolled to the middle ->
UIListLayout.VerticalAlignment = Centerin aScrollingFrame. UseTop. - Kit piece drawn over its own button ->
ZIndexBehaviordiffers from the kit's (Sibling: children above parent;Global:ZIndexacross the ScreenGui). Match the kit.
Limits
| Item | Value |
|---|---|
Phone top bar (GetGuiInset().Y) | ~58 px |
| Design order | ~667×375 phone, ~780-850 × 360-390 phones, 1024×768 tablet, desktop, TV |
UIScale per object | one applies; remove a kit's own before scaling the same object |
| ~1.4k-instance window built in place vs detached + parent once | 55 ms vs 24 + 17 ms (field-measured) |
1. Safe areas and measurement
CoreUISafeInsetsavoids cutouts and core UI (docs: use for interactive UI);DeviceSafeInsetscutouts only;Nonefor non-interactive or true-centre content.- Top-centre widget: own ScreenGui,
ScreenInsets = None,IgnoreGuiInset = true; Y at the middle ofTopbarInset, X at screen centre clamped toTopbarInset.Min.X..Max.X; re-place onGetPropertyChangedSignal("TopbarInset")and resize. Too wide -> drop a chip, never skip the clamp. - Phone windows go under
TopbarInset.Max.Y, centred, not slid sideways.GuiService.TouchControlsEnabled = falsehides thumbstick and jump; restore on close. PlayerGui.TouchGuihas its own insets (field: 685×280 vs a 685×338 HUD): convert before comparing. It can appear after your first layout: re-fit onPlayerGui.ChildAddedand whenPreferredInputbecomesTouch.Camera:WorldToViewportPointmatches a ScreenGui withIgnoreGuiInset = true.GetMouseLocation()includes the inset;PlayerGui:GetGuiObjectsAtPosition()expects it removed.BillboardGuichildren sized in offset don't shrink with distance and balloon across the screen: use scale +TextScaled.
2. Gamepad focus
One owner of GuiService.SelectedObject per view:
- Back unwinds one layer; exit restores the opener if visible, else clears. Auto panels never steal focus. Menu keys must
Passwhile any window is open (roblox-input). SelectionGained/SelectionLostpass aGuiNavigationDirection(Nonewhen not from navigation): treat as hover. Thin default outline on TV: setPlayerGui.SelectionImageObject.
3. APIs and quirks models get wrong
- Flex is
UIListLayout.HorizontalFlex/VerticalFlex+UIFlexItem(noUIFlexLayout).UIGridLayoutignores childSize, wraps byFillDirectionMaxCells.TextBox: one deduplicated submit forFocusLost(enterPressed)andReturnPressedFromOnScreenKeyboard. UIGradient: animateOffset/Rotation, notColor/Transparency(rebuilds); not onScrollingFrame/TextBox;RadialignoresRotation;TypealsoElliptical/Conical;TileModeClamp/Repeat/Mirror.ParticleEmitter2D(beta "UI Particles", enable in Beta Features) <!-- temporal: 2026-11 -->:Emit()works while disabled;Clear()removes live particles;EmissionModePoint/BoundingBox;TimeScale = 0freezes for capture.Size/Speedare offset units: a desktop-sized effect covered half a phone's UI (DevForum), so scale fromAbsoluteSize.- Fusion
Hydrateputs the instance in the scope (cleanup destroys it); Fluidroot()teardown does not destroycreate()instances. - Never
RichTexton player text (tags inject styling). - Looping tweens with
DelayTimepark at the end between loops.ViewportFramemeshes can take seconds to appear after Play.
4. Verification
Measure first (AbsolutePosition/AbsoluteSize of anything that could collide), then screenshot. The built-in Studio MCP's rbx-device-simulator-lua skill plus screen_capture cover phone, tablet, desktop and console presets and orientations (roblox-studio-mcp); confirm PreferredInput is Touch before judging touch layout. Studio capture missed BillboardGuis that a SurfaceGui showed (field).
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/tabooharmony/roblox-brain/roblox-ui">View roblox-ui on skillZs</a>