I am using c# and am stuck working on the keybindings. As of now I am using:
void OnGUI (){
Event e = Event.current;
if(e.isKey)
{
keyboard.keys[num] = e.keyCode;
}
keys is a keycode array and keyboard is another script that has that array. For the controls them selves I want to be able to use keys[1] as the keycode but am not sure how to go about doing that. I thought that this would work but it doesn’t:
if(Input.GetButton(keys[1]))
any ideas on what I need to do?
As it’s a key you need to use Input.GetKey(keys[1]) - I’d suggest using an enum so you dont have to remember which integer relates to which actions too - just to avoid hard to spot bugs later.