1
\$\begingroup\$

As the title states I am having an issue with the following. It is a pretty specific edge case but it is something I can't work around.

In Unity I have created two Axes to allow me to check the value of the of the left and right bumpers on an Xbox controller. The problem I am having is the controller I am using is a special product where by default the left and right bumper are always on. This is intended on the controller and is definitely not changeable. The issue here is that because the controller has the bumpers pressed in by default when Unity is launched it reads the input of those buttons with a value of 0 instead of 1 (as I have the controllers set to provide a positive input).

I've tested this with a normal Xbox controller by manually pressing the trigger in before I launch the game and I get the same results so I can confirm that it is a Unity thing and not a controller issue. The only way to fix the controller's input is to manually refresh the bumpers (which are attached to sensors in this case).

This is currently not an acceptable way for me to refresh the device I just need to get the devices correct input immediately. Is there a way I can, in code, not have the game recognize the controller until I specify? The reason for this is if I plug my device in AFTER the game starts I get the correct values.

This game will only ever be run on Windows so I would be open to coding up an OS level script that utilizes some of the Windows functions.

EDIT: I thought I should add I have tried sending visualized input to the device via code and this has not fixed the issue.

\$\endgroup\$
1
\$\begingroup\$

I've found that using XInput.Net fixed the immediate problem for me. As what I need to do is fairly simple I think this is going to be a good solution.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.