- Home /
How to zero out the value of the joystick
Hello guys. So my xbox joystick is messed up and is slightly off when not touching it. So instead of the input.getAxis("Horizontal") returning 0 when nothing is touched, it returns something like .08. I want to make a feature in my game where you click a button that says "zero joystick" and when you click it it will set that current position of the joystick equal to 0 for the axis. That way if someone has a joystick that is slightly off (like mine), then they will be able to play normaly without the player constantly moving very slowly.
Like I want it so that the zero joystick button sets the zero of the joystick to the current position of the joystick axis. Idk if that makes sense to you guys but i really need help on this.
normally you configure a dead zone where input is just ignored. it's available in the Input manager for the axis.
the other solution would be saving the current value from the joystick when you press a button and always subtract it from the current reading
Your answer
Follow this Question
Related Questions
How do I create joystick controls with two fixed speeds? (3D) 1 Answer
How do I add input for two different local players? 1 Answer
Problems with joystick / controller axes being 1/-1 "way too often" 1 Answer
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
How to find Joystick Axis? 0 Answers