Gamepad Input only works in right and up directions?

Hi,

currently testing the new Input System because i want to make a local multiplayer game.
I set up the Inputs for WASD-Keys, works fine for now.

When i test it with a gamepad, i use the same script and assign the left stick.
Up and Right works as intended, but Down and Left always stays zero.

I’m working with Unity 2019.1 and Input System Version 0.2.6

Keyboard outputs a range from (-1.0, -1.0) to (1.0, 1.0)
Gamepad outputs a range from (0.0., 0.0.) to (1.0, 1.0)

Also at some point i got an error where left and down on gamepad was out of range.
unfortunately i deleted the project that throwed the error, because i thought there was something broken.
(i changed unity-version and wasn’t sure if everything went fine…)

Am i missing something for gamepad input or is this a bug?

Looks like this is the problem i’m running into, but not sure:

Also (as mentioned in the thread above) “Gamepad.current.leftStick.ReadValue()”
works better, but when i try pushing down and left at the same time it results in (0.0, 0.0).
BUT i can go left and also down, but not at the same time.
Thanks in advance.
edit: added some info

Hi,
I meet the same issue on gamepad stick (left and right), only up & right are working. If I use the dpad, it works.

It seems the down/left stick directions are not recognized by the new input system. I’ve tried in binding section to use the “listen” button, push one of these directions and the expected path is not recognized, only the stick itself and the axis are proposed but not the specific direction.

I test with a logitech F310, but not sure this issue is device specific.

Thanks in advance.

Regards,

Guillaume

Came here to report the same issue.

Windows
Unity 2019.1.0f2 (current)
Using Input System 0.2.8 (current)
Xbox One Controller
Binding Path: leftStick/left [XboXoneGamepad], also same issue with others I tested.

1 Like

Hi, I’ve had this issue too. What I eventually did was rather than using separate inputs for each direction, I bound the entire game pad’s left stick to my movement vector2. I then passed this through a script which would then get the angle and magnitude the stick was going relative to north. I could then determine which direction the player should move (for example, 315 to 45 degrees would be moving upwards).

Hope this helps.

1 Like

I too am having this issue with an xbox 360 controller. Similar to what Sir-Magic stated, I added a binding (not a composite) to my Movement action. For the binding path I just selected leftstick [Gamepad]. Then in my handler in my script I read the Vector2 value:

    public void OnMovement(InputAction.CallbackContext context)
    {
        var dir = context.ReadValue<Vector2>();
    }

And I get values in the range of -1f to 1f for both axes.

3 Likes

I created a binding and just added “left stick [Gamepad]” to it.
When reading the value i do: Vector2 direction = context.ReadValue<Vector2>();

Haven’t found any problems with that solution yet

EDIT: Also, under Movement, continuous is checked

1 Like

If you have issues like the original post, this may likely be device and OS specific - but we also landed a lot of fixes, so could you try if you get the same in 0.2.10?

Hello,

I tried the solution proposed by camcha, and didn’t find leftStick option in dropdown list. Related to leftstick, only Press event is present.
So I tried with LeftShoulder (which has the options of a stick… so maybe a display bug on the leftstick label), but taking this path, it didn’t work at all, as expected as Leftshoulder is not a stick unlike what is shown in the dropdown list.
4596940--429106--upload_2019-5-30_18-41-3.png

So for people who meet the same issue, I had to modify the path of the binding directly in the json of the generated class by replacing the path by this one:
““path””: “”/leftStick"",
EDIT: It’s not a satisfying workaround as the modification is needed to be done each time the Input Action is changed and regenerated.

Jonas, for a potential device/OS specific issue, I’m on PC on Windows 10 so nothing really fancy ;-).
And I use the version 0.2.10 of the package.

4596940--429109--upload_2019-5-30_18-44-21.png

Could you guys vote on this issue so we can get this fixed: Unity Issue Tracker - [Windows] Gampad stick not navigating right in UI

@dougpunity3d pushed a fix for this issue yesterday.

2 Likes

This issue is still there. And it not gamepad specific issue.
I tried with xboxone controller and logitech F310 on windows 10.

2D Vector Composite does not work with controller sticks. Left and Right stick does not work with this binding. Only Up and Right is working. Left and Down is not working.

Please fix this.

.

1 Like

I have the same issue with the latest package.

1 Like

Okey , This is fixed. But its not in the version that in the package manager!

If you want fix for this , go and download from the github but the development brach. Dont download stable branch if you want fix for this.

Please consider providing where did you push the fix and how to obtain fixed version :slight_smile: