Hi, I’m trying to find a way to accurately make a device checker. This will allow me to know what device the user is playing on so I can properly make my system that I would like to create.
As I know some of the methods can cause false positives, I’m looking to get the player’s device accurately.
You could use UserInputService.TouchEnabled to detect if its mobile because if it returns true then that player is likely a mobile player, if not then its a computer player. If you want to detect if a player is on xbox then use this GuiService:IsTenFootInterface().
But what if the player changed from mobile to computer or the other way around?
Hi, this is exactly what I’m talking about when I mean false positives I seen other users say that touch screen computers return this as a mobile device.
Touchscreen computers usually default to being registered as non-touch if they have a keyboard attached, and if not then they are basically playing on mobile/tablet anyways.
I have never encountered such issues in my code, but if you still don’t believe me then you may use ContextActionService's BindAction with the createButton argument set as true which will only appear if a player is on mobile.
Yes, I’m trying to like 100% accurately log whether or not the user is playing on a mobile or pc device. I know for xbox I can just simply use Gamepad.
Basically the only way to do this is through UserInputService.TouchEnabled and UserInputService.GyroscopeEnabled. Roblox does not collect hardware information.
I’m trying to make something like arsenal a natural in game hitbox expander. Arsenal has it so if your on a mobile device/tablet the hitbox part is bigger for such users.
It doesn’t have to be exact then. You could probably check every so often if the user is still on a keyboard/touch device. A touchscreen laptop is the equivalent of a tablet with a bluetooth keyboard, or a keyboard specially designed for say a USB-C.
Likes @2jammers stated, it is not possible to be 100% accurate in device-type detection.
Using UserInputService.TouchEnabled and UserInputService.GyroscopeEnabled as well as GuiService:IsTenFootInterface() for gamepads is as accurate as you can get.