-1

In Unity InputManager (Edit -> Project Settings -> Input) I can define and name different inputs. I have an event called "Draw" that happens when joystick button 0 is pressed. This seems to be working. However, I cannot tell which controller pressed the button as the Joy Num option only works with axis and not with buttons. How to do that?

// How to tell which controller?
bool pressedDraw = Input.GetButtonDown("Draw");
Antti_M
  • 904
  • 10
  • 20

2 Answers2

0

The same button on different joystick is defined as its own button, as documented here.

Joystick1Button0
Joystick2Button0
...
Antti_M
  • 904
  • 10
  • 20
0

joystick 1 button 0, joystick 2 button 0 It has to be like this. Keeping it here for my self as well if I ever start looking for same question. Go through all the numbers in a loop till 20 based on your joystick. Log each button event so you know if it's pressed down. Easiest way to know which button is being pressed.