What do you want to achieve? I want to test XBox controller input on my PC. I’ve never used an XBox controller and I’m not using this for anything but Roblox right now.
What is the issue? Roblox is not detecting that my controller is plugged in.
What solutions have you tried so far? I just bought this controller new, plugged it into my PC, and updated the driver.
I ran some code that indicated Roblox was not detecting the controller input
the code
local UserInputService = game:GetService('UserInputService')
UserInputService.GamepadConnected:Connect(function(gamepadNum)
print(('gamepad %s connected!'):format(gamepadNum))
end)
UserInputService.InputBegan:Connect(function(input, gpe)
print(input.UserInputType.Name)
if input.UserInputType == Enum.UserInputType.Gamepad1 then
print('ahhh!',input.UserInputState)
end
end)
while wait(1) do
print(UserInputService:GetGamepadConnected(Enum.UserInputType.Gamepad1))
end
I’m on Windows 8. I installed the driver and according to my PC it’s working properly but…apparently not?? I keep pressing the power button at the top but it doesn’t flash or anything. so I don’t know if the problem is that it’s not “on” or what. It’s a wired PowerA controller. Does anyone have any insight or experience using XBox controllers on PC for Roblox?
I can’t seem to find anywhere to download the correct driver for it so I followed this guide which led me to the result of seemingly installing an XBox 360 driver… any tips on where I could download the correct driver? Surely I can download it somewhere despite being on Windows 8
You are using InputBegan instead of InputChanged. That is the reason why. Your thumbstick’s position is changing every frame or so, meaning its input is changed.
The code is not the problem. These are tests I quickly threw together to measure what was happening. Even the loop at the bottom prints false. I added an InputChanged event checking if the input.UserInputType == Enum.UserInputType.Gamepad1. That does not print. The initial InputBegan event would print if I pressed any buttons on it. It did not print.
I don’t really know what you’re asking. If you want to get joystick positions and input, then use InputChanged, if not, then use InputBegan. It works as it should.