Hi, I need to integrate Controller Inputs in my game. The Controllers works fine in the editor, but when i build the Metro app and run it, none of the Inputs are detected. I am checking the Controllers connected using the “Input.GetJoystickNames ().Length > 0” and it returns true when the controller is connected. But no inputs.
I have a Metro Universal game in the Windows Store that has Xbox 360 controller support and it does not have the problem you are describing. I also use xboxControllerConnectedState = Input.GetJoystickNames().Length > 0; to detect the controller.
I am using the free version of Unity 3d 4.6.3f1 and Visual Studio Community.
I am using a Xbox 360 wired controller. I have implemented code so that when I insert the cable into the USB port Xbox controller button graphics pop up on the screen indicating what button causes which game object to be activated.
You can test with my game if you like. It is completely free with no ads. It is a simple card game and is called “21 Silos”. By the way, after you win a hand you are awarded a rocket which you can then use to shoot down UFOs. After you start the game press the “Start” button on the controller (Located just below and to the right of the big Xbox button. Then use the A, B, X, and Y buttons to place a card in a column.
While confirming the Xbox controller also still works with the release build in the store, I noticed that I do not display the Xbox controller button graphics while in rocket game mode. I will be fixing that this week end.
How are you getting input from the joystick? Unity has a nasty habit of assigning joysticks to arbitrary Id’s in Windows. So you may be trying to get input from Joystick 1 when Unity really assigned it to Joystick 3. If you’re only supporting 1 player, you can set your input manager settings to get input from all joysticks and it will cover over this issue.
However, if you want a much more comprehensive input solution, I suggest you check out Rewired, an advanced input system I’ve developed that makes working with joysticks in Unity a much easier experience, among many more great features. You can get a free trial on the website.