Expose a privacy-safe Phone vs Tablet form-factor API to experiences

As a Roblox developer, it is currently difficult to reliably distinguish a phone from a tablet at runtime.

The existing APIs answer related but different questions:

  • UserInputService.PreferredInput tells me how the player is likely interacting.
  • TouchEnabled tells me whether touch is available.
  • GuiService.ViewportDisplaySize tells me the approximate size class of the current viewport.

None of these tell me whether the device is a phone or tablet.

This matters because phone and tablet experiences can need different default UI density and control layouts even when both use touch and both fall into the same general viewport category. At the moment, developers are pushed toward hacky viewport/aspect-ratio heuristics or manual “Phone / Tablet” settings (like Murder Mystery 2), which are less reliable than a platform-provided classification.

I would like Roblox to expose a deliberately coarse, privacy-safe form-factor API, for example:

local DeviceService = game:GetService("DeviceService")

if DeviceService.FormFactor == Enum.DeviceFormFactor.Phone then
    setupPhoneLayout()
elseif DeviceService.FormFactor == Enum.DeviceFormFactor.Tablet then
    setupTabletLayout()
end

Possible enum:

Enum.DeviceFormFactor.Unknown
Enum.DeviceFormFactor.Phone
Enum.DeviceFormFactor.Tablet
Enum.DeviceFormFactor.Desktop
Enum.DeviceFormFactor.Console
Enum.DeviceFormFactor.TV
Enum.DeviceFormFactor.XR

I am specifically NOT requesting exact model information, serial numbers, hardware IDs, GPU information, or other fingerprintable device data.

The property could be:

  • Read-only
  • Client-side / NotReplicated
  • Coarse only
  • Allowed to return Unknown on clients where Roblox cannot classify reliably

This should complement the existing APIs rather than replace them:

  • FormFactor = what general kind of device is hosting Roblox
  • PreferredInput = how the player is currently controlling Roblox
  • ViewportDisplaySize = how much display space is currently available

That distinction is useful on devices such as an iPad using a controller or keyboard, foldables, touch PCs, and windowed clients.

Use cases include:

  • Automatically selecting a phone or tablet UI instead of asking the player manually
  • Different touch-control density and placement
  • Inventory/shop layouts appropriate to the form factor
  • Better accessibility defaults while still allowing player overrides
  • Understanding whether a UX issue disproportionately affects phone or tablet players
  • Avoiding unreliable resolution/aspect-ratio device-detection hacks

For analytics, Roblox could optionally expose DeviceFormFactor as an aggregated built-in dimension rather than requiring experiences to maintain per-user device histories.

The privacy boundary is important: the API should expose only the coarse category. Exact device models and identifiers should remain unavailable to normal experience scripts.

A platform-owned enum would give developers a stable semantic signal while allowing Roblox to handle iOS, Android tablets, foldables, and future form factors consistently.

Currently, creators can adapt to input and viewport size very well. The missing piece is a supported way to answer this: “Is this mobile device a phone or a tablet?”

3 Likes

According to PlayerModule.ControlModule.TouchJump:

  • local isSmallScreen = minAxis <= 500

I agree however something like this should be added. Oh, wait.

Mmm, but no, this is for the Studio-only emulator. Oh, wait!

Everytime someone mentions checking the device for the UI makes me angry.
Every good UI designer knows that making your UI dependent on the device type is stupid.

You could be on XBOX but have a normal monitor, not a TV.
Same for mobile and so on.

The global answer for UI is this:

1 Like

Hi. I am not asking Roblox to replace responsive design with device detection. Just querying them to expose form factor as an orthogonal signal. ViewportDisplaySize answers viewport size while PreferredInput answers input method, and neither answers whether a touch device is a phone or tablet. That’s the main problem.

Doesn’t have to be about UI
You could use it to display device type user is playing on

Maybe just ask player their device type like in Murder Mystery 2.

1 Like