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

Forum Archive How do use sense when a left or right arrow key is pressed? Reply To: How do use sense when a left or right arrow key is pressed?

#25610
Jonathan Gonzalez
Participant

    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.