Lesson 3 of 6
Console, VR and the 10-foot screen
Get a Roblox game ready for Xbox, PlayStation and VR: 10-foot text, the TV-safe area, gamepad menus with no dead ends, Controller Emulator, console release rules and a VR comfort check on Beacon Yard.
By the end you can
- Size Beacon Yard's text and margins for a TV about 3 metres away, using GuiService.ViewportDisplaySize and the TV-safe area
- Find and fix gamepad dead ends with selection groups and a Back button, and test them in Controller Emulator
- Name what a console release needs: content ratings, no chat window, the console device setting
- Run a short VR check and switch off what makes a headset uncomfortable
Before this: UI design: Figma to Studio, hierarchy, accessibility, Input everywhere, part 1: keyboard, gamepad, touch and accessibility
1Three metres from the TV
Open the finished game at m14-ship and look at how Beacon Yard sizes its interface. Every screen calls one helper:
local shorter = math.min(size.X, size.Y)
uiScale.Scale = math.clamp(shorter / 720, 0.65, 1.4)
It reads the shorter side of the viewport in pixels and divides by 720. That was the right fix for phones in UI fundamentals: ScreenGui, UDim2, layouts. Now think about two players. One has a 15.6 inch laptop, 60 cm from their eyes. The other has a 55 inch TV, 3 metres from the sofa. Both screens are 1080 pixels tall.
Console players sit 8 to 10 feet (2.4 to 3 metres) from the screen, and Roblox's console guidelines ask you to build for that ten-foot experienceTen-foot UIAn interface built to be read and used from a sofa, about 3 metres from a TV, with a gamepad.Think of it as the menu board on the wall of a café, not the menu in your hand.1.
UiScale.luau runs on the laptop (1920 by 1080) and on the TV (1920 by 1080). What does this print?
local function scale(x, y)
return math.clamp(math.min(x, y) / 720, 0.65, 1.4)
end
print(scale(1920, 1080), scale(1920, 1080))
Answer
1.4 1.4. Pixels alone cannot tell a laptop from a TV. Both get UiScale 1.4, so the TV shows the same pixel sizes to a player five times further away.
Open this step in lesson mode · Link to this step · This confused me
2How big text looks from the sofa
What your eye sees is the angle a letter covers. A pixel on the 55 inch TV is bigger than a pixel on the laptop, but the TV is five times further away. Divide the height of one pixel by the distance and you can compare any two screens.
| In the picture | In Roblox |
|---|---|
| Reading the board from the back of the café | Reading the TV from a sofa about 3 metres away, so the same pixels look smaller |
| Bigger letters on the board | Larger text when GuiService.ViewportDisplaySize is Large, such as Beacon Yard's Larger text setting |
| A pillar that hides the edge of the board | A TV that crops the outer edges of the picture, so essential UI stays in the TV-safe area |
A phone or laptop is the menu in your hand. A console is the menu board on the wall across the café: the same words need bigger letters, because you read them from the back of the room.
Think of it as The menu board on the wall across a café, instead of the menu in your hand
Run the cell. The heights are the picture heights of a 16:9 screen: 19.4 cm for the 15.6 inch laptop and 68.5 cm for the 55 inch TV.
local function pixelLooks(heightCm, rows, distanceCm)
-- how tall one pixel looks: centimetres of screen per centimetre away
return heightCm / rows / distanceCm
end
local laptop = pixelLooks(19.4, 1080, 60)
local tv = pixelLooks(68.5, 1080, 300)
print(string.format("TV needs %.2f times the pixels", laptop / tv))
TV needs 1.42 times the pixelsBeacon Yard already has a lever for this. The Larger text setting multiplies every registered label by Config.LARGE_TEXT_SCALE, which is 1.3. That is close to the 1.42 the distance asks for. A good default for a TV is to start with Larger text on, and let the player turn it off.
The shop buttons use 24 px text. Using the 1.42 factor from the cell, how many pixels should that text be on the TV to look as big as it does on the laptop? Round to a whole pixel.
Answer
34 px (within 0.5). 24 × 1.416 is about 34 px. Larger text at 1.3 gives 31 px, which is close; a studio would check it on a real TV before shipping.
Open this step in lesson mode · Link to this step · This confused me
3The edges a TV may cut
Roblox has a better signal than pixel counts. GuiService.ViewportDisplaySize is Small on most phones and tablets, Medium on most laptops and monitors, and Large on most TVs2. The older GuiService:IsTenFootInterface() is superseded: it returns true on any console, however the player is using it3.
Size is half the problem. Some TVs do not show the picture all the way to the edges, so the guidelines ask you to keep UI inside the TV-safe areaTV-safe areaThe part of the picture every TV shows. Some TVs cut off the outer edges, so essential UI stays inside.Think of it as the part of the wall a pillar never hides.1. They give no number. Microsoft's guidance for Xbox apps does: keep essential UI out of the outer 5 percent of each edge4. On a 1920 by 1080 picture that is 96 px from the sides and 54 px from the top and bottom.
Now read where Beacon Yard puts its stats panel:
panel.AnchorPoint = Vector2.new(0, 0)
panel.Position = UDim2.fromOffset(16, 16)
panel.Size = UDim2.fromOffset(460, 0)
The panel sits 16 px from the left edge, and the toasts sit 20 px above the bottom edge. ScreenGui.ScreenInsets keeps UI clear of phone notches and the Roblox top bar, but its documentation says nothing about TV overscan, so do not count on it here.
On a 1920 px wide picture, the safe area starts 96 px in. Beacon Yard's stats panel starts 16 px in. How many pixels further right must it move?
Answer
80 px. 80 px. Placing it at a scale of 0.05 instead of a 16 px offset keeps it 5 percent in on every screen width.
Open this step in lesson mode · Link to this step · This confused me
5Fence the highlight in
A second guard keeps the highlight inside a panel. Any frame can become a selection groupSelection groupA GUI container with SelectionGroup set to true, whose SelectionBehavior properties decide whether gamepad selection may leave it.Think of it as a fenced pen: the highlight can move freely inside, and the gate decides whether it can wander out.: set SelectionGroup = true and its SelectionBehaviorUp, Down, Left and Right properties apply. Escape, the default, looks inside the group first and leaves when nothing fits. Stop keeps the selection inside5. For a modal panel such as settings, Stop on all four sides is the usual choice.
Roblox also offers a virtual cursor as an alternative to directional selection, and the guidelines suggest bespoke navigation for unusual layouts1. For a column of buttons, directional selection is the better fit.
You set SelectionGroup = true and every SelectionBehavior to Stop on the settings panel, then press down on Larger text. Nothing looks different from before. Why?
Answer
No other selectable button is on screen, so even Escape found nowhere to go; Stop protects the panel when one is added later. Today Escape and Stop behave the same, because nothing else is selectable. The fence matters the day someone adds a button to the HUD.
Now test the café analogy against the last two steps. The board picture explained text size and margins well. Answer before you open the breakdown.
Where does it break?“The menu board on the wall across a café, instead of the menu in your hand” is a good picture of a ten-foot console screen. Where does it stop being true?
It breaks here. A menu board is only read. A console menu is also walked one step at a time with a D-pad, so it can trap the player in a dead end and needs a way back, which no board has.
The true model. A console screen is read from far away and driven by sequential gamepad navigation. Size and margins answer the distance; selection links, selection groups and a Back button answer the navigation.
Which console problem does the café menu board picture not explain at all?
Answer
A settings panel the player cannot get out of with a gamepad. The board covers distance. Navigation (focus, selection groups, dead ends and Back) needs its own model: a graph of buttons you walk one press at a time.
Open this step in lesson mode · Link to this step · This confused me
6Before you switch Console on
Console reach is opt-in. Which devices can play is a setting of your experience, and the Creator Hub's activity history logs every change to its playable devices6. Before you turn Console on:
- Content ratings. Games designed for consoles always need content ratings, or they risk being removed from consoles1.
- No chat window. Roblox asks you to disable the chat window for console games, however you customise chat. The chat window and input bar can be switched off in Studio or from a script7.
- Button icons that match the pad.
UserInputService:GetImageForKeyCode()returns Roblox's Xbox or PlayStation icon for a key code, so a hint never shows the wrong button1. - Haptics, sparingly. A
HapticEffectcan rumble the pad for the drone's hit8. Constant vibration annoys players, so keep it for moments that matter1.
Beacon Yard uses chat for one game message. When a drill starts, RoundService asks AnnounceService to post a system line:
pcall(AnnounceService.say, "Drill started")
RoundService announces "Drill started" through AnnounceService, which writes a system line in the chat window. With the chat window off on console, how does a console player know the drill began?
Answer
The HUD's Phase stat changes from Idle, because the HUD reads the round phase separately. Never make chat the only place important news appears. In Beacon Yard the Phase stat already covers the drill start.
Open this step in lesson mode · Link to this step · This confused me
7A short VR check
Roblox runs VR through OpenXR, so Quest headsets and PC VR headsets share one implementation9. You will not build a VR mode here. You will check what a headset player meets in Beacon Yard.
- Scale feels real. In VR one stud is
0.3 m / Camera.HeadScale10. The drone's 12 studs per second becomes a speed a player feels in their stomach. - The camera belongs to the player's head. Roblox's default camera scripts support the comfort options (vignette, stepped rotation, a fixed third-person camera), and replacing them opts you out of those updates9. Tilting or rolling a VR player's view can make them dizzy10.
- Beacon Yard's Zoom.
CameraClienttweensFieldOfViewbetween 70 and 50 when you press Q or Y. That is a deliberate change to what the player sees, the kind of camera motion comfort settings exist to soften. Turn it off whenVRService.VREnabledis true (a property you can only read in a LocalScript)11. - Performance. Quest's Auto Quality Mode aims for at least 72 frames a second, and the guidelines recommend streaming, fewer draw calls and fewer transparent parts9.
Beacon Yard's drone moves at DRONE_SPEED = 12 studs per second. With HeadScale = 1, one stud is 0.3 m in VR. How fast does the drone come at a headset player, in metres per second?
Answer
3.6 m/s (within 0.05). 3.6 m/s, a fast run. On a flat screen the drone is a threat; in a headset it is a thing rushing at your face, which is worth testing on a real headset before you enable VR.
Open this step in lesson mode · Link to this step · This confused me
8Choices, and what studios do
Other ways pros do this
| Option | What it is | When pros pick it | Trade-offs |
|---|---|---|---|
| Default directional selection | Roblox moves the highlight to the nearest selectable button in the pressed direction. | Simple columns and grids, like Beacon Yard's shop. | Odd layouts can jump to a surprising button; test every direction. |
| Explicit NextSelection links | Set NextSelectionUp, Down, Left and Right on each button. | Layouts where the nearest button is not the logical next one. | Every new button needs its links updated, or it becomes unreachable. |
| Selection groups with Stop | Fence the highlight inside a panel with SelectionGroup and SelectionBehavior. | Modal panels: shop, settings, dialogs. | Every fenced panel needs a Close button or a bound Back action. |
| Virtual cursor | A pointer the stick moves, built into Roblox. | Dense or free-form UI such as maps and inventories. | Slower than directional moves for a simple list. |
You want Beacon Yard to start with Larger text on when it runs on a TV. Which value should the client read?
Answer
GuiService.ViewportDisplaySize, and treat Large as a TV. Read GuiService.ViewportDisplaySize. Large covers most TVs, whatever input the player uses.
Open this step in lesson mode · Link to this step · This confused me
9Build along: menus with a way out
Open your own copy of the finished game. Choose Test > Device Simulator to show the toolbar above the viewport. The toolbar is available in the full release. The Controller Emulator can emulate Xbox, PS4 and PS5 pads, Quest controllers and an Android TV remote12.

Select a numbered pin, or a row below, to read what it marks.
Beacon Yard on a simulated console: the shop opened with the X button, Speed selected, and the Controller Emulator lighting up the pad.
Build along
src/client/SettingsGui.luausrc/client/Controls.luau
In the Device Simulator toolbar, pick a Console device. Open Virtual controller from the toolbar or Controller in the Emulation tab, then choose Xbox. Press Play, click the emulator so it has focus, and drive everything from the pad: walk to the Quartermaster, open the shop, close it, then open Settings and try to back out. Also note what D-pad up does now.
You should see X at the Quartermaster opens the shop with Speed selected, and B closes it. D-pad up opens Settings with Reduced motion selected, and B leaves the panel open.
In
SettingsGui.luau, setpanel.SelectionGroup = trueand all fourSelectionBehaviorproperties toEnum.SelectionBehavior.Stop. InControls.luau, add aCloseSettingsaction onEnum.KeyCode.ButtonBwith no touch button (copyCloseShop, and add the name toActionName). Bind it when the panel opens; unbind it and clearGuiService.SelectedObjectwhen it closes.You should see Pressing down on Larger text keeps the highlight on Larger text, and B closes the Settings panel and clears the selection so the stick moves the character again.
Open this step in lesson mode · Link to this step · This confused me
10Build along: text, margins and VR
Now the screen itself. Keep the console device and the Xbox pad from the last step.
Build along
src/client/Accessibility.luausrc/client/Hud.luausrc/client/CameraClient.luau
In
Accessibility.start, next to the line that seeds ReducedMotion fromGuiService.ReducedMotionEnabled, readGuiService.ViewportDisplaySizeinside apcall, print it, and when it isEnum.DisplaySize.LargerequestLargeTextonce, with the same "only send a true" rule. The docs do not say which size Device Simulator reports for a console, so if yours reads Medium, test the branch by comparing against Medium for one run, then put Large back.You should see The Output shows the display size. When it reads Large, Settings already shows Larger text: on when you open it, and the shop's 24 px button text becomes 31 px.
In
Hud.luau, change the stats panel's position fromUDim2.fromOffset(16, 16)toUDim2.fromScale(0.05, 0.05), and the toasts' fromUDim2.new(0.5, 0, 1, -20)toUDim2.fromScale(0.5, 0.95). Switch between a phone, a desktop and a console device and check each.You should see The stats panel starts 5 percent in from the left and top edges, and the toasts sit above the bottom 5 percent, on every simulated device.
In
CameraClient.luau, readgame:GetService("VRService").VREnabledand skip binding theCameraFieldOfViewaction when it is true. Leave everything else alone. If you have a headset, try a drill in it before you change anything else.You should see On your desktop, Q still zooms between 70 and 50, because VREnabled is false there.
Put the steps to take Beacon Yard to consoles in a sensible order.
Answer
1. Fix dead ends and text size, and test with Device Simulator and Controller Emulator 2. Turn off the chat window for console players and move anything important out of chat 3. Complete the content ratings questionnaire 4. Test on a real console and TV, then turn on Console in the experience's playable devices. Fix and test in Studio, remove console blockers, get rated, then verify on real hardware before players can see it.
Open this step in lesson mode · Link to this step · This confused me
11Challenges and recap
Fix sameLookPx so it compares how big a pixel looks from each seat, not only the distances. The laptop and TV are the ones from this lesson.
local LAPTOP = { heightCm = 19.4, rows = 1080, distanceCm = 60 }
local TV = { heightCm = 68.5, rows = 1080, distanceCm = 300 }
local function sameLookPx(px, from, to)
-- Bug: this only compares distances. A pixel's look depends on
-- its height (heightCm / rows) divided by the distance.
local factor = to.distanceCm / from.distanceCm
return math.round(px * factor)
end
print("24 px on the laptop is", sameLookPx(24, LAPTOP, TV), "px on the TV")
Level 1, Apprentice
Challenge
Fix sameLookPx in the sofa-check cell so all three tests pass.
- Start from
- The game at milestone m14 (download)
- Check it here
- Run the code cell in the lesson view; the challenge completes when it passes. No Studio needed.
Done means
- sameLookPx uses each screen's heightCm / rows / distanceCm
- 24 px on the laptop gives 34 px on the TV, and 18 gives 25
- All three assertions in sofa-check pass
Hints
- Work out how tall one pixel looks on each screen (heightCm / rows / distanceCm); the factor is from divided by to.
- math.round(24 * 1.416) is 34.
Solution
local factor = (from.heightCm / from.rows / from.distanceCm) / (to.heightCm / to.rows / to.distanceCm)
Retiring the analogy
You no longer need “the menu board on the wall across a café, instead of the menu in your hand”. A console screen is read from far away and driven by sequential gamepad navigation. Size and margins answer the distance; selection links, selection groups and a Back button answer the navigation.
Recap
- A TV is read from about 3 metres away: pixel-based scaling cannot see that, so read GuiService.ViewportDisplaySize and treat Large as a TV.
- Text needs about 1.4 times the pixels on a 55 inch TV at 3 m; Beacon Yard's Larger text (1.3) is the lever, switched on by default for Large.
- Keep essential UI out of the outer 5 percent of a TV picture: scale positions, not 16 px offsets.
- Every menu needs a way out from every button: a Close button reachable by D-pad, or B bound while it is open, and a selection group with Stop for modal panels.
- Console needs content ratings and no chat window; VR needs a comfortable camera, so Beacon Yard skips its FOV zoom when VREnabled is true.
A ten-foot console screen is the menu board on the wall across a café, instead of the menu in your hand, until a menu board is only read. A console menu is also walked one step at a time with a D-pad, so it can trap the player in a dead end and needs a way back, which no board has.
Queued for review
- UiScale.luau runs on the laptop (1920 by 1080) and on the TV (1920 by 1080). What does this print?
- On a 1920 px wide picture, the safe area starts 96 px in. Beacon Yard's stats panel starts 16 px in. How many pixels further right must it move?
- Which change makes Beacon Yard's settings panel work like its shop for a gamepad player?
- You set SelectionGroup = true and every SelectionBehavior to Stop on the settings panel, then press down on Larger text. Nothing looks different from before. Why?
- You want Beacon Yard to start with Larger text on when it runs on a TV. Which value should the client read?
Next UI frameworks, part 1: React-lua, elements, props and state
Open this step in lesson mode · Link to this step · This confused me