0
\$\begingroup\$

the problem is that if I connect a command the array GetJoystickNames increases an index but if you disconnect it does not reduce the index and continues counting as if it were connected

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Can you show us the code you're using? I presume you're actually writing C#, not the deprecated language UnityScript as specified in the question tags you've chosen? \$\endgroup\$
    – DMGregory
    Jun 20, 2019 at 18:04

1 Answer 1

2
\$\begingroup\$

You don't. As per the GetJoystickNames documentation (version 2019.1):

Note that some entries in the array may be blank if no device is connected for that joystick number.

As such, the length of the array is not intended to correspond to the number of connect joysticks.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .