Get player's platform(mobile, console, PC, etc.)

I want to get a player’s platform to set a text of a button accordingly.

  • Is there already a service or module to get such information?
  • Is it possible to get the exact platform? (PlayStation or Xbox)

What I’ve tried:

  • Using UserInputService to get KeyboardEnabled, TouchEnabled, and GamepadEnabled, but for some reason that didn’t work.
    turns out that wasn’t the part that was broken, it was another part of the script
1 Like
local UIS = game:GetService("UserInputService")

if UIS.KeyboardEnabled then
      print("Player is on PC.")
elseif UIS.TouchEnabled then
      print("Player is on Mobile.")
elseif UIS.GamepadEnabled then
      print("Player is on Console.")
end
1 Like

This isn’t entirely accurate; a PC Player can have a controller connected, as well as have a touch screen.

However, it should work close enough, since this is mainly used to optimize the game for that device/controller/touch screen

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.