title: Simulate keyboard buttons to use Input.GetAxis ("Horizontal")
body: <p>I've been stuck on this for a while and I would appreciate your help.</p>
  
  <p>I need to port a game to mobile devices and as a result I need to change the control scheme to take into account taps.</p>
  
  <p>I want to keep using Input.GetAxis ("Horizontal") since the game was built and balanced around it, and just simulate a left/right keystroke whenever a player taps on the left/right side of the screen.</p>
  
  <p>Is that in any way possible?</p>
  
  <p><strong>onUpdate:</strong></p>
  
  <pre><code>touchMove()
   playerPosition.x += Input.GetAxis ("Horizontal") * playerVelocity;
   transform.position = playerPosition;
  </code></pre>
  
  <p><strong>To check taps</strong></p>
  
  <pre><code>private void touchMove()
       {
           if (Input.touchCount &gt; 0)
           {
               Touch touch = Input.GetTouch(0);
  
               if (touch.position.x &lt; Screen.width/2)
               {
                   //simulate a left keyboard push
               }
               else if (touch.position.x &gt; Screen.width/2)
               {
                     //simulate a left keyboard push
               }
           }
       }
  </code></pre>