How to increase xbox controller joystick deadzone?


#1

Hello! I’m working on a local multiplayer game for a school project and am trying to implement controller support. When I connect my xbox one controller however, my in-game character inconsistently moves to the side.

I believe it is due to the joystick’s tendency to lean in certain directions over time. I should be able to easily combat this by increasing the joystick’s deadzone, but I cannot figure out how to do that. I have created a DefaultJoystickAxis object and tried values ranging from 0.01f all the way to 10000f for the deadzone, but the problem persists.

Any help would be greatly appreciated. Thank you!


#2

Creating your own won’t really do anything because it’s not connected to anything.

Find the existing Joystick object you want to modify. Find the axis on it that you want to modify. Cast it to DefaultJoystickAxis and set the dead zone.

In theory, it should work.


#3

Figured it out! Used inputManager.setDeadZone or something like that.