Xbox 360 D-Pad and Triggers Not Registering to Unity Input

A few days ago I posted a question on Unity Answers, and so far it looks like it got completely lost in the mess with no answers nor comments. So, I figured I’d ask this here, since it seems to be a Unity problem rather than a coding problem.

I tried playtesting my game to make sure it was registering controls properly and I noticed that Xbox 360 D-Pad and Triggers simply don’t work when two Xbox 360 controllers are plugged in at once. Having only one plugged in, it seems to work fine.

Here’s the problem: I’m developing a fighting game. More often than not, people would rather play 2-player locally with two arcade sticks, which are almost guaranteed to be received as XInput given the new Steam controller support. Why? Because offline locals = inherently less lag. In fighting games, even 1 frame of lag can sometimes be too much for people, despite online still being essential to a successful fighting game.

My game’s input is being managed using GetKey()/GetKeyDown(), and I would prefer to have the same control over XInput axes (without the use of Project Settings->Input), but at this point that’s not really going to be realistic as far as I can see.

So then my question here is: Is this just a bug in Unity? And is there any good workaround to this issue?

The Unity Answers post I created is here: https://answers.unity.com/questions/1529735/xinput-d-pad-and-triggers-not-working.html

If you need any more information, or want me to test in specific situations I may not have considered, please let me know and I’d be happy to give a response as soon as I can.

Welp… not even a word on what I could potentially be doing wrong in my post? Too much info? Not enough info? Too complicated of a problem? No agreements or disagreements? Nothing? I sincerely doubt the Unity community is small.

Edit: If anyone’s not posting out of fear they won’t get their answer accepted, you can probably see I’m relatively active on checking, so I’ll mark your response as the answer if it gets solved. Just please, I really want to find a way to fix this.

Okay, this is getting pretty ridiculous. I see certain other questions get answered within a couple of days and sometimes even within an hour, and yet my question hasn’t been even commented on in an entire week.

On a previous account, people would always comment within moments of me posting telling me I need to provide more information or that it’s not enough information to answer. Then, when I would provide said information, they would just disappear with the excuse “nobody would ever read through that information, it’s too long!”. Now it seems when I just give the right amount of information, people don’t even bother to look at it.

I wish that Unity would at the very least make the Answers forums more bearable for both askers and answerers. Many answerers wish for better systems to allow their answer to be accepted when the asker has not bothered to. Likewise, many askers get frustrated because answerers aren’t compelled to answer any questions that aren’t “hao 2 move gaemobject 1 unit?” because it’s a bigger risk of not being marked as an answer.

Hell, if there was a way Unity could just be contacted and given a link to the answers page, then have someone answer it from Unity, that would be a preferable workaround. The only problem is that the contact pages literally push community pages in your face no matter what, and there’s no way to actually contact Unity with non-sales questions.

It’s really hard to tell the difference sometimes between a bug in Unity and a problem with my own project setup or environment, and it makes it even harder when literally nobody confirms or denies it. Are there really that little people who can plug in an Xbox 360 controller, set up the triggers/dpad on an axis, make a small script to debug log GetAxis(), and just reply saying “On version X it works for me using Y controllers at a time” or something?

Even if someone commented at least expressing they’d like to answer and that they need time to do that, at least that amount of recognition that someone even viewed my post would be great. When I don’t hear anything for a few days, I think people just missed my post. When I don’t hear something for nearly a week, I get the impression that the community is specifically ignoring me for some reason. As I said, some people get answers within an hour, or within a day or two. Either that or they get absolutely no answers whatsoever and the question is left untouched for years.

And just for clarification’s sake, yes I did search other questions to see if other people had my issue and I found abandoned questions from one or two years ago. One of which had no answers, so I asked the asker if they found a solution. The other had the OP answer their own question describing how they worked around it, so I commented and asked if they found something else since I’m having the same problem, yet their solution didn’t fix it for me. Guess how many I got a response on? Neither.

Maybe Unity should force users when they look at a question to interact with it in some way (vote, comment, or reply) before leaving or they lose rep. Maybe then people would stop just reading questions, going “oh wow that’s not a generic FAQ question guess i’ll ignore it”, and then ignoring it.

Sounds like you ran into one of the many different limitations of the existing Input API. Your best solution would be to stop using the existing Input API and either use the early preview that is currently in early preview or use a third party solution like Rewired.

Unfortunately I don’t have multiple Xbox controllers to do any testing for you. I don’t remember having this problem with my offbrand controllers but it has been over a year since I last needed to do any testing with them.

We’re not a small community but we’re not evenly distributed either. While I believe this is was the correct location for the subject of your thread the reality is this section sees far less activity than other sections and posting elsewhere may have been a better choice. Worst case even if the mods moved the thread the ghost left behind would still attract viewers.

A better title wouldn’t have hurt either. My suggestion would be “Multiple Xbox controllers not being recognized”. When searching for solutions to your problem that was the most common wording used.

I think most people consider this section to be for questions about using the Unity editor. Implementation questions usually get answered very quickly in the Scripting section.

Anyway, whether you’re using XInput or Unity Input, have you specified the joystick numbers? I just tested 4 Xbox 360 controllers using input axes defined in the Unity Input Manager (not the new input system), and it worked fine. If you’re using XInput, are you using a wrapper or another asset on top of it such as Rewired or InControl?

Thanks for posting! I was losing hope I’d ever get a response… I’ve been going through rough times personally, and I tried to game dev to cheer myself up… sadly, I’m too stupid to get anything done…

How would I use the early preview? I’m using Unity Hub, so would that require getting a beta version of Unity? If not, how would I go about it? I actually haven’t seen anything about the new Input API.

I guess that makes sense. A big community, but dispersed in multiple areas. I didn’t really think of that possibility. Also, I didn’t factor in that this was possibly the least viewed board. I saw 40-ish views on my post at the time and felt “why couldn’t any single one of them chime in an opinion? i’m open to suggestions!”

I just want to understand what you’re saying, should I be using more general terms so I can get more people to at least view my question? Or is there something else you’re getting at with the specific terms in that title over the ones I used?

I’ve specified joystick numbers. Here’s a screenshot of the Input Axes for one of the controllers (The other specifies joystick 2): https://imgur.com/a/uynRhwW

Whether or not I use snap, the value in Debug Log doesn’t change when I press down on triggers. Not until two controllers are plugged in or not.

I’m just using the standard Project Settings->Input panel for all of my axes, no XInput wrappers and no external assets. In fact, the only imported asset I’ve even used was a 3D model file for testing purposes. No asset packages from the Unity store were imported at all.

As for my controllers, they’re both XInput compatible. One specifically “made for PC” (probably works on a 360, but I can’t test that at the moment, Steam recognizes it as a 360 controller though) and the other specifically made for Xbox 360. I also have an Xbox One controller I can test, if you want.

Yes, there are some serious bugs with Unity’s XInput controller handling including triggers not working or getting crossed up among different plugged in devices. [You can read my explanation of it here]( Still Xbox 360 Joypads bug on Windows... unbelievable. page-2#post-2527596).

I suggest you use a controller tester to see what’s happening on all devices. There’s a free one here you can use. Or you can download the Rewired trial and use the included DevTools/UnityJoystickElementIdentifier to see what’s coming back from Unity’s system. If you see triggers activating on a different controller when you press them on another controller, you know you’ve hit the bug and Unity can’t tell which HID device is equivalent to which XInput device and your only solution is to abandon Unity’s input system for something better.

2 Likes

You need at least Unity 2018.2 (beta or final). Once you have that you download the files from the repo. There are HTML-based documentation files in the repo as well as a wiki.

https://github.com/Unity-Technologies/InputSystem
https://github.com/Unity-Technologies/InputSystem/wiki

Sorry for all the late replies.

I’ll definitely check this out first. Once I download the files from the repo, do I just stick it into the engine installation files? Or would this be something I put in the project files somehwere?

Edit: Nevermind, there are instructions on the repository page. Though, something to be aware of is that it says I specifically need a beta for Unity 2018.2. I don’t mind using it, I just wanted to point it out.

Thank you for providing a ton of information on this regard! The thing is, I’m not using more than four controllers plugged in. I have tried unplugging all controllers, saving my project, closing Unity and restarting my computer, then plugging in only two gamepads and loading Unity back up. The issue still persists so long as there is more than one controller plugged in.

While I do agree that there are bugs with the Unity XInput controller handling, I do find the situation really odd and tricky. For example, when I set up my controller in PCSX2, sometimes it registers the controller as a completely separate input device when it deals with certain axes such as triggers or right stick. At least, that’s what I instantly thought of when you were explaining how Unity handles XInput.

By the way, another user here suggested I use the new input managing Unity offers, which is currently in beta. I’ll take a look at that and provide back my results, but I’ll always be sure to give Rewired a go as well. Thank you all for your suggestions!

You don’t have to have more than 4 controllers for this to be an issue. If it thinks the first HID device is the first XInput device but it’s the other way around, you’re going to get the problem. That sounds like what’s happening in your case. There isn’t anything you can do to make it get the association correct. Whether it happens on your machine or not depends on the order the HID devices are appearing in the registry. That’s why resetting Unity won’t help and usually restarting the computer won’t either. You could try removing all the devices in Device Manager and see if it creates the HID devices in a different order.

Well, I think at this point the point is that the error occurs. Not sure if anyone would be willing to go through that to make their controller work for my game, so I’ll definitely check out Rewired and then the new Unity Input Manager afterwards to weigh my options.

Hi, there is a bug reported for a very similar situation in which Joystick axis 9 and 10 not work with 2 or more Xbox One controllers connected on Standalone builds, currently, that bug has a fix in the 2018.3.0a6 Beta release available for testing here:
http://beta.unity3d.com/download/33e5def6e55f/public_download.html

Could you please try this release to check if the problem is still reproducible?

Sorry for not responding for a long time, things got busy as my parents were moving houses and needed my help. When my desktop is set back up, I’ll try this out along with the previous two fixes. Thanks for all of your help!

So I’m having a bit of an issue with the beta when trying to access an imported material. If I can’t fix it I’ll probably post the issue in a new post using the proper forum category.

Okay, this issue is a bit bigger than I thought it’d be. Gonna make a new post.