Search Issue Tracker
Won't Fix
Votes
3
Found in
5.3.2f1
Issue ID
767182
Regression
No
[Input] Input.GetJoystickNames.Length doesn't always return a correct number of connected controllers
Reproduction steps:
1. Open attached project "Joysticks TEST"
2. Open scene "JoysticksTestScene"
3. Enter play mode
--- GUI label will tell you the value of Input.GetJoystickNames().Length
4. Connect a controller (I used Xbox 360 and Xbox One controllers)
--- You should see Input.GetJoystickNames().Length increase
5. Disconnect the controller
--- Input.GetJoystickNames().Length stays the same
Code used in the project:
void OnGUI()
{
GUILayout.Label("JOYSTICKS LENGTH:::: "+Input.GetJoystickNames().Length);
}
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Inaccurate Box Collider boundaries on a rotated child Cube when the parent GameObject Scale is non-uniform
- [Android] "SHADOWS_SCREEN" set as shader Keyword when no "_ShadowMapTexture" is bound leads to freeze on a build on some Mali GPU devices
- The global scene list is overridden in a project built with command line when the Override Global Scene List setting is disabled in the build profile
- [Linux] AutoLocale log is logged when opening a project
- Global Scenes are not included in the Build when building multiple Build Profiles at the same time
igUnity11
May 20, 2016 21:20
Input.GetJoystickNames can return an entry with null entries. Even if Length is 1, the array may be empty.