Multiple Keyboard Inputs

Hi, I have a question, is there a way for me to get multiple keyboard inputs at once? For example, the user needs to hold the “Right Shift” Key and then click the “Enter” Key to fire a gun, or hold the “Left Shift” Key and then click the “Enter” key to swing a sword. I tried using an If statement to check if the first key is held down, and if it’s true, I would check if the second key is also held down. So far, that didn’t work.

Thanks in advance.

You should be able to test for multiple keys at the same time. This works like a charm for me:

function Update () {
  if(Input.GetKey("m")  Input.GetKey("n")) {
    Debug.Log("Look, this works!");
  }
}

Can you share your code with us?

Oh silly me, I got confused between the GetButton and GetButtonDown. But it works now. What I did was use an if statement to check if the first button is held down (GetButton), and nested in that if statement is another button is held down. The effect is that you press one button first and then click on the second button. Instead of having to press both buttons at once, which is the effect of using an AND in one if statement to check for both buttons.

Thanks for the reply, HiggyB! :smile: