title: Unity Android Touch.position, can't move
body: <p>Hey I am new to javascript and Unity. I am making my first app and I'm trying to get touch.position to work on my android phone. I just can't figure out how to get my character(a ball named Bal) to move left,right,up and down. Also can't get Bal to jump.</p>
  
  <p>Here is my code: </p>
  
  <pre><code>#pragma strict
  
  var rotationSpeed = 100;
  var jumpHeight = 5;
  //(x,y,w,h) pixel coords.
  var rectButton1 = Rect(-0.12, 0.13, 76.1, 96.61);
  var rectButton2 = Rect(0.21, 0.13, 76.1, 96.61);
  var rectButton3 = Rect(0.81, 0.26, 15, 58);
  private var isFalling = false;
  
  function Update () {
      for (var touch : Touch in Input.touches) {
      if (rectButton1.Contains(touch.position)) {
              var rotation : float = Input.GetAxis ("Horizontal") * rotationSpeed;
              rotation *= Time.deltaTime;
              rigidbody.AddRelativeTorque (Vector3.left * rotation);
      } else if (rectButton2.Contains(touch.position)) {
              var rotation2 : float = Input.GetAxis ("Horizontal") * rotationSpeed;
              rotation2 *= Time.deltaTime;
              rigidbody.AddRelativeTorque (Vector3.right * rotation2);
      } else if (rectButton3.Contains(touch.position) &amp;&amp; isFalling == false) {
              rigidbody.velocity.y = jumpHeight;
      }
              isFalling = true;
  }
  }
  
  //No infinite jump!
  function OnCollisionStay ()
  {
  isFalling = false;
  }
  </code></pre>