title: Move player on touch Unity C#
body: <p>I created a simple script to move player on Keyboard input, though now I want to move player on touch input, how do I do this ?</p>
  
  <p>Here's my code, so how do I edit this code to make it work ? I have jump working, but dunno how to do it for moving ? </p>
  
  <pre><code>using UnityEngine;
  using System.Collections;
  
  public class MoveGround : MonoBehaviour
  {
      public float y = 0f;
      public Rigidbody2D rb;
      //public float x = 0f;
      //public float z = 0f;
  
      // Use this for initialization
      void Start()
      {
          rb = GetComponent&lt;Rigidbody2D&gt;();
      }
  
      // Update is called once per frame
      void Update()
      {
          //move function
  
          if (Input.GetKey(KeyCode.W))
          {
              rb.velocity = new Vector2(0, y);
          }
  
          if (!Input.GetKey(KeyCode.W))
          {
              rb.velocity = new Vector2(0, 0);
          }
  
          if (Input.GetKey(KeyCode.S))
          {
              rb.velocity = new Vector2(0, -y);
          }
          //move function end
      }
  
      public void Move()
      {
      }
  }
  </code></pre>