I’m having trouble getting any analog joystick values from my gamepad. The sticks work correctly (verified by Hardware Tester), and I can get input events from the buttons just fine.
But I cannot get any values from any joystick. I checked for InputEventJoypadMotion events in _input(), and I get none. Input.get_axis("stick_left", "stick_right") remains zero when I jiggle the sticks (I have added all stick axes to the “stick_xxx” events), and so does get_joy_axis().
The button events, however, work fine (even those mapped to the D-pad). Any ideas what I could try?
Don’t you have the deadzone set too high for the actions that are mapped to joystick axes? Try using Input.get_action_strength according to the instructions in the documentation:
Nope, no values on Input.get_action_strength() either. The deadzone has the default value of 0.2; event setting it to 0.0 doesn’t change anything. I would normally assume that my gamepad has a problem, but on the the hardwaretester.com site, the sticks both work perfectly.
The controller is an Xbox-type clone. Input.get_joy_name(0) returns “Xbox Wireless Controller”. I don’t own any games that use the sticks, so I can only test it with the hardware test site mentioned in my original post, and they work perfectly there,
OK, more testing: I’ve downloaded the official Godot “Joypads (Gamepads) Demo” from Joypads (Gamepads) Demo - Godot Asset Library and it doesn’t recognize the stick movement either. Almost all buttons work (even the “stick buttons”, ie. pressing on the stick), except the lower triggers, which do work on the hardwaretester site.
The gamepad’s UUID is 58626f7820576972656c65737320436f, and it is included in the Godot gamecontrollerdb.txt file, which makes me think it should work… The entry does say platform:Android, though, but I’m, not sure what this means…?
Yes, it makes me think that Godot has problems accessing the stick values. It can’t be (or, is very unlikely to be) the OS or the gamepad, as the hardwaretester site can see the stick movements, so the gamepad->BT->Mac->macOS->browser->JS path works.
So if you are connecting to bluetooth, then it makes sense for the controller to be in the Android section as thats more than likely the device type its supposed to connect to rather than Windows.
It may only be marketed as a controller for Android, and hence why its only in that section of the DB. Thats the only reason I can think of as to why its not working.
The controller is designed for Xbox, Windows, Mac, iOS, tvOS, and a whole bunch of other platforms (probably Android, too.) Doesn’t work with USB, though. But again: The sticks are working, it’s only Godot that doesn’t see them. (I’m on macOS, btw.)
What does it mean when a controller is listed with “platform:Android”? I don’t think it means “this controller works only on Android” (the whole section wouldn’t make any sense then, since there is no Godot IDE on Android.)
I think there’s probably something wrong with the way Godot maps this controller’s inputs to the axes (likely something to do with the leftx:a0,lefty:a1 part of that record, but that’s just a guess.)