Check if controller button is pressed?

How would I check if a button on a controller is pressed if “userInputService:IsKeyDown()” doesn’t work with controllers and “userInputService:IsGamepadButtonDown()” is not enabled yet?

image

Keep track of it yourself using InputBegan and InputEnded.

1 Like

:confused: is there any ETA on when the feature will be enabled?

I’ve never used it, but I think you might be able to use GetGamepadState for this.

4 Likes

userInputService.InputBegan:connect(function(input, processed)
if input.UserInputType == Enum.UserInputType.Gamepad1 then
if input.KeyCode == Enum.KeyCode.ButtonL2
then
print(“TEST”)
end
end
end)

3 Likes