Question by
rodrigozol · Feb 20, 2021 at 04:31 PM ·
inputinput.getaxisinput.getkey
Check any Input.GetAxis from any Joystick
Can I check any Input.GetAxis like is possible in Input.GetKey? Looks like Input.GetAxis needs a specific name of the Axis like Input.GetAxis("Horizontal"), I want to check any "inputed" axis, without define a name. Below a code that works with key / joystick button.
Any clue? Tks.
for (var i = 0; i < 20; i++) {
if (Input.GetKey("joystick button " + i))
{
textJoy.text += "JoyButton0: " + i + "\n";
}
}
Comment