Lets say I want to use numeric 1-9 to select control groups or toggle weapons or whatever. Do I need to define a action for each single one of those or can I somehow just create 1 action and pass the pressed key as parameter?
You can bind the same action to arbitrary many controls and then check the control in the callback. For something that’s specific to just keyboard, you could do
void MyActionCallback(InputAction.CallbackContext context)
{
var key = ((KeyControl) context.control).keyCode;
// ...
}
1 Like
thanks a lot, that works perfectly (and I probably could have found out myself sorry!)