Theres no information about it on the Documentation other then values.
I’ve tried this but it prints idek every time (I’m using an Xbox One controller)
local gamepad = Enum.UserInputType.Gamepad1
if gamepad == Enum.GamepadType.XboxOne then
print("The gamepad is an Xbox One controller.")
elseif gamepad == Enum.GamepadType.PS4 then
print("The gamepad is a PlayStation 4 controller.")
elseif gamepad == Enum.GamepadType.PS5 then
print("The gamepad is a PlayStation 5 controller.")
elseif gamepad == Enum.GamepadType.Unknown then
print("Unknown gamepad type.")
else
print("idek")
end
I don’t think Roblox allows people to use that Enum, or it just doesn’t work in general. To figure out if a player is using a PlayStation remote or a Xbox remote, I use the following API:
local userInputService = game:GetService("UserInputService")
local buttonA = Enum.KeyCode.ButtonA -- 'A' button on xbox controllers ('X' on PlaySation)
local str = userInputService:GetStringForKeyCode(buttonA)
local isXbox = str == "ButtonA" -- if 'str' is ButtonA, then this will evaluate to true, otherwise, it'll be false
-- if the result of 'str' is ButtonA, then the user is on Xbox
-- if the result of 'str' is ButtonCross, then the user is on PlayStation
if isXbox then
print("playing on xbox")
else
print("playing on PlayStation")
end
I only have access to an XBox controller at the moment, so do you know if there’s anyway to test if this really works? Any apps that create a fake gamepad?