Xbox controller issue

Hi there!

I using Xbox controller to my game and I found that
the left joystick can work with a small moved, it just not even outer of the center
it very sensitive, so I would like to make it can only work when it pushed full stroke
is this possible?

Thanks!!!

Hi!

To fix this you could try raising your input dead zone threshold. If you are using the legacy InputManager, you should go to Edit > Project Settings > InputManager and raise the Dead value of your horizontal and vertical axes.

1 Like

Thank you for your answer!
Yes I already set Dead to 0.5 or many values But it still sensitive anyway
I don’t know what is the right value, I want it to work when full push of stroke.

Then I think you could raise it even more or, in your own code, only use the input data when the axis value equals 1 or -1.

Also, maybe you could share a snippet of your code to make sure you are reading the input properly. Are you using Input.GetAxis to read the values?

1 Like

Yes I just use

float vForce = Input.GetAxis("JoyVertical");

in my code
and my input manager is

Name : JoyVertical
Gravity : 0
Dead : 0.5
Sensitive : 1
Type : Joystick Axis
Axis : Y axis
Joy Num : Get motion from all joysticks

Hi! Then maybe you can raise your Dead to 1 or, in your code, only consider values of vForce equal to 1 or -1.

1 Like

Oh I tried aleady, But it changed to cannot control

Ah, so this may be due to the fact that you are only going to have values of 1 and -1 when the joystick is perfectly aligned up or down. As soon as it is oriented a little to the left and right, the vertical value will become smaller and the value of the horizontal axis will increase.

You can simply use values close to 1 (something like >0.9). Or, to make it more correct, you could calculate the magnitude of the vector formed by the horizontal and vertical axes to be 1, or close to 1.

Something like: new Vector2(horizontal, vertical).magnitude > .95f. And only accept input if this condition is met.