Hello, this is my first time scripting for phones, and I would like to know how know if the user is on phone, console or mobile.
What’s the best way of doing it (for accuracy)?
Hello, this is my first time scripting for phones, and I would like to know how know if the user is on phone, console or mobile.
What’s the best way of doing it (for accuracy)?
At the moment, there is no official way to check for that sadly. This topic by crazyman32 made a feature request for it, but it got no response.
There is a :GetPlatform()
method, but it can only be used by Roblox core scripts.
This page shows some possible ways you might be able to check for the console.
There is also this hacky way to do so.
You can check whether someone’s on mobile
if UIS.TouchEnabled and not UIS.KeyboardEnabledand not GuiService:IsTenFootInterface()
However it is not only not very robust, but it also won’t always work generically with many devices
What’s your use case?
You can dynamically adapt to what device a user is using with the methods available to you in UserInputService rather than an unsupported workaround, given that devices can have unexpected input devices checked off. Specifically here, for example, GetLastInputType.