Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How can i see what device a Player is on?

So i have a Console mode and a PC mode on my game, i used the detect if GamePad is connected for the Console mode which works fine but how can i detect if a Player is Playing on the Mobile App? So the game can switch to a Mobile Ui.

1 answer

✓ Accepted answer

I doubt you can get specific product in use. However UserInputService has various 'Enabled' properties which imply what device a LocalPlayer is on. Like, TouchEnabled tells you the player in on a mobile device.

In example:

local uis = game:GetService('UserInputService')
local mobile = uis.TouchEnabled
local console = uis.GamepadEnabled
local pc = not (mobile or console)

if mobile then
	--do mobile stuff...
end

This is why scripters need to use UserInputService over Mouse stuff. It's useful!

This discussion is preserved as it was. New answers, comments, and votes are closed.