Search Issue Tracker
By Design
Votes
0
Found in
5.4.2f2
Issue ID
950555
Regression
No
[iOS] Input.GetKey() doesn't work with game controllers on some devices
Steps:
1. Build and Run user's project ("GameCntrollerSample.zip") on iOS device
2. Connect a game controller
3. Press buttons on game controller
Expected behavior: KeyCode is shown in the screen
Actual behavior: Text on the screen stays the same, Input.GetKey() does not register that buttons were pressed.
Test results:
iPhone SE | iOS9.3 | reproduced
iPhone 6 | iOS8.0 | not reproduced
iPad 5th gen | iOS10.3.3 | not reproduced
iPod 6th gen | iOS10.2.1 | not reproduced
iPhone 7 plus| iOS10.3.2 | not reproduced
Reproduced with: 2017.3.0a3, 20172.0b11, 2017.1.1p2, 5.4.6f1.
Used Horipad Ultimate game controller.
BY DESIGN:
This happens because 'GameController.framework' is not included in the Xcode project. We add it automatically if 'UnityEngine.Input.GetJoystickNames()' is called anywhere inside the Unity project to avoid including it in projects which do not use gamepads. So simple checking if any controllers are connected with 'Input.GetJoystickNames()' before executing any gamepad related code should fix this issue. Alternatively, you could add 'GameController.framework' to your project either manually or using https://docs.unity3d.com/ScriptReference/iOS.Xcode.PBXProject.AddFrameworkToProject.html.
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- UI Source Image property gets set to 'None' when using a specific Sprite and Play mode is entered
- Rendering locks up when not looking at a transparent material on Meta Quest 2
- Volumetrics break when using a Custom Pass to create a Thickness Buffer for Alpha Clipping
- All tests are run instead of only the failed ones when the "Rerun Failed" button is pressed
- GameObject is not masked when the "Render PostProcessing Effects" pass executes with a resolved non-MSAA Color target and MSAA DepthStencil target
Add comment