Game dev is challenging, and while making User Interfaces, thinking of User Experience, button layouts, button behavior, etc. The device a Player is using requires explicit attention and directs unique pathways of development.
As a Roblox developer, it is currently too hard to, accurately determine/know what device a Player is using.
Current methods I have seen and used to detect devices include
Big thanks to - qDevice - A utility for getting user devices - Roblox
Mobile:
UIS.TouchEnabled or UIS.TouchEnabled + ScreenSize
This Can create false positives if a player is on Laptop with a Touch Screen
Further, the new ROG Ally x will be classified as a mobile device.
Console:
GuiService:IsTenFootInterface()
Straight forward, but kind of hidden, I didnât know this even existed for about 2 years.
Computer:
not UIS.TouchEnabled & not GuiService:IsTenFootInterface() ~ I guess?
ROG Ally x
No idea yet
Iâll Included Controllers here
local BUTTON_A_KEYCODE= Enum.KeyCode.ButtonA
Gamepad is an Xbox Controller
UIS:GetStringForKeyCode(BUTTON_A_KEYCODE) == "ButtonA"
Gamepad is a PlayStation Controller
UIS:GetStringForKeyCode(BUTTON_A_KEYCODE) == "ButtonCross"
The returned string from BUTTON_A_KEYCODE dynamically changes in GetStringForKeyCode at runtime?
Feels like something we need to stumble upon.
Most of these methods, especially to a new developer, are hidden or strange behaviors to stumble upon. Most are in UserInputService another thrown into GuiService, and we have to trust these methods are accurate enough.
Since the addition of, Input Action Service, PreferredInput, and ViewportDisplaySize, these are and is the way forward. But developers still donât have the full picture.
We need a layer deeper for specific Device Detection.
If Roblox is able to address this issue, it would improve my development experience because:
- Developers would not have to jump through hoops and stumble upon existing methods to accurately determine what device a Player is using.
- Improve development time and productivity
- Let us focus on making games, not hacking device detection
- Increase trust that the device a Player is using is correct!
- Remove false positives
Side note:
I found DeviceForm | Documentation - Roblox Creator Hub
But it looks like this isnât used anywhere inside Roblox.
UIS.DeviceForm â would be ![]()
Thanks for reading.
Looking forward to hearing your input.