Best way to distinguish between Phone and Tablet?

Currently, to distinguish between Computer, Mobile and Console, I do this:

I want to make this more specific so that within Mobile, it can then distinguish between phones and tablets. What’s the most effective way to do this?

Is there any reason you want to do this? The input devices are the same, resolutions vary, and sizes vary.

I want to specifically change the GUIs for phones, as their screen sizes are by far the smallest.

I would strongly recommend making it universal. There is no guarentee if someone is going to have a 4 inch phone vs a 6 inch phone or an 8 inch tablet vs a 12 inch tablet.


It’s worth pointing that some computers, spec. all-in-one computers, are both touchscreen and keyboard/mouse enabled, so your code might return mobile for such devices. It’d be best checking out for a gyroscope as most modern phones and tablets have those, alongside checking out for a mouse.

1 Like

AFAIK this isn’t the case right now. Not exactly something you can rely on for the future, in the case Roblox decides to support multi-touch touch screens.

If you’re trying to accomplish universal GUIs, I would just make the GUI fit for all sizes, it takes some time to get it perfect, but the studio emulator does the job nicely. :+1:t2:


My recommendations say to scale the UI’s all to 1:1 meaning it’ll fit all devices and sizes perfectly!

not a good idea for cases where buttons are too small or overlap mobile controls, there’s a lot of positioning/sizing adjustments to make via logic to get it correct realistically.

I’m looking for a way to do this in order to hide my custom leaderboard on phones but not iPads, to replicate the behavior of the default leaderboard. Are there any known methods to do so?

1 Like