I basically want the player to be able to press any button and to store which one it was so that they can map abilities to that button. Obviously I can check against specific buttons but I would need to do that for every button on the keyboard, on the mouse and on game controllers which would be really excessive. Is there a way I can just get a return value that I could store and then check for later? I want this to work for any button on keyboard/mouse/controller if possible.
I believe your best bet would be to use the Input.inputString and grab the first pressed character. That’s the only input event I see that gathers data on what was pressed.
The only way to do this is to fill your InputManager with every single possible joystick axis and joystick button combination available. That’s 11 joysticks with 20 axes and 20 buttons each. Then you poll every one via Input.GetButton or Input.GetAxis and take the first result. You then do the same for all keys using Input.GetKey with every keycode available. Yes, it’s ridiculous, but it’s the only way to capture everything which is what you want for assignment. You end up with an InputManager with 451 entries (some for the mouse too). For certain platforms that fall back on Unity input, that’s how I do it in my Rewired Advanced Input system. For platforms that use native input, there’s no such cludge because I can get input directly from the devices.