jaunger1999
New member
Hi,
I was trying to use the ControllerConnected state and found some issues with it.
The line 339 in PlayerInput.cs
var controllerConnected = Input.GetJoystickNames().Length > 0;
always returns true for me.
There is always one entry in the array that's a blank string if I don't have a controller connected.
I changed this line to
var joystickNames = Input.GetJoystickNames();
var controllerConencted = joystickNames.Length > 1 || (joystickNames.Length == 1 && joystickNames[0] != "");
Another issue I found is that the state is only active if I connect the controller after starting Play Mode.
I did not find a fix for this.
I'm using Unity 2020.322f1 Personal
Thanks.
I was trying to use the ControllerConnected state and found some issues with it.
The line 339 in PlayerInput.cs
var controllerConnected = Input.GetJoystickNames().Length > 0;
always returns true for me.
There is always one entry in the array that's a blank string if I don't have a controller connected.
I changed this line to
var joystickNames = Input.GetJoystickNames();
var controllerConencted = joystickNames.Length > 1 || (joystickNames.Length == 1 && joystickNames[0] != "");
Another issue I found is that the state is only active if I connect the controller after starting Play Mode.
I did not find a fix for this.
I'm using Unity 2020.322f1 Personal
Thanks.
Last edited: