We need an official way of checking if a gamepad is Xbox or Playstation

I am fully aware that Roblox isn’t interested in giving devs the ability to see the players current platform, but unfortunately there is a usecase where this is needed.

As a Dev, if we want to show xbox buttons or playstation buttons based on the platform type, we effectively have to use a hack like this:

function IsPlaystation()
	return UserInputService:GetStringForKeyCode(Enum.KeyCode.ButtonA) == "ButtonCross"
end

Otherwise I wouldn’t be able to show/hide the correct gamepad icons that I’ve purposefully given the player (ex below)
RobloxStudioBeta_EgZbsvSWRS
RobloxStudioBeta_sXZwwCj5q5

I’m not alone in this issue, I’ve talked to other devs who use similar hack workarounds as the only other option is to use the coregui gamepad buttons which can really limit creative expression.

13 Likes

I had to solve this problem as well for my button class and Virtual Valley Games’s games. My hack relies more replacing individual images when they are requested, as opposed to performing a global check for the platform. I think a better way of describing this feature request is we need an official way to provide platform-specific button icons, because figuring out and testing my solution is just too much work to provide themed buttons.

4 Likes

Shouldn’t the request be to check what kind of controller the player is currently using? If a player wants to use their Xbox controller with their PC (AKA me, although not on Roblox), just requesting platform won’t cut it.

6 Likes

Actually that’s a really good point, I’m gonna update the title to reflect that

2 Likes