Getting Raw Input Data From Controller
I've been trying to program my custom input manager for a few days now and can't quite seem to get this part done. I need to be able to read input from each axis or button on a controller without it being defined in the Input section of the project. This is to help those who don't know how to program still be able to create their own games with ease. For example; we all know the following line throws an error along the lines of "Control not defined in input settings" or something like that.
if (Input.GetButton("joystick button 0")) return true;
How can I get around adding each and every axis and button for all control types to the input settings?
Thanks in advance, Jamie
Still searching for an answer; here's a little snippet I'm working on, but it's the standard code that throws the error:
public static bool GetControl(XBOXControl Control) {
switch (Control) {
case XBOXControl.A: if (Input.GetButton ("joystick button 0")) return true; break;
case XBOXControl.B: if (Input.GetButton ("joystick button 1")) return true; break;
case XBOXControl.X: if (Input.GetButton ("joystick button 2")) return true; break;
case XBOXControl.Y: if (Input.GetButton ("joystick button 3")) return true; break;
case XBOXControl.Start: if (Input.GetButton ("joystick button 7")) return true; break;
case XBOXControl.Select: if (Input.GetButton ("joystick button 6")) return true; break;
case XBOXControl.LeftBumper: if (Input.GetButton ("joystick button 4")) return true; break;
case XBOXControl.RightBumper: if (Input.GetButton ("joystick button 5")) return true; break;
case XBOXControl.LeftThumbstickPress: if (Input.GetButton ("joystick button 8")) return true; break;
case XBOXControl.RightThumbstickPress: if (Input.GetButton ("joystick button 9")) return true; break;
}
}
AFAI$$anonymous$$ it was always available in the Input $$anonymous$$anager but it was never clear which axes and buttons it used.