How do use sense when a left or right arrow key is pressed?

posted to: Create a Pause Menu
  • Jonathan Gonzalez(jgonzalez) replied

    The arrow keys can be used with the "Horizontal" or "Vertical" axis based off the input manager if you want to keep things fairly open ended. If you want to see how these values change with the arrow keys you can add a debug.log in the update method:


    void Update{

    Debug.Log ("Horizontal " + Input.GetAxis ("Horizontal") + " Vertical " + Input.GetAxis("Vertical"));

    }


    To check if these are pressed use "Input.GetAxis("Horizontal")" or "Input.GetAxis("Vertical")", the vertical is for the up and down arrow keys, while horizontal is for the left and right arrows. 

  • Godfrey Thompson(360xd) replied

    I want to sense if the left or right arrow key is pressed.

    I think it is somthing like: Input.GetKeyDown("")

    But I dont know what to put in the "".