title: Unity Android Touch Controls Not Working - 2D
body: <p>I have this script which i created to detect UP and DOWN swipes. All it needs to do is change the UI text..</p>
  
  <p>The script is below:</p>
  
  <pre><code>using UnityEngine;
  using System.Collections;
  using UnityEngine.UI;
  
  public class TouchControls : MonoBehaviour 
  {
      private Vector2 startPos;
  
      Text instruction;
  
      void start() {
          instruction = GetComponent&lt;Text&gt;();
      }
  
      float swipeValue = 0.0f;
      void Update()
      {
          #if UNITY_ANDROID
          if (Input.touchCount &gt; 0){
                  Touch touch = Input.touches[0];
                  if(touch.phase == TouchPhase.Began){
                      startPos = touch.position;
                  }
                  else if(touch.phase == TouchPhase.Ended){
  
                      swipeValue = Mathf.Sign(touch.position.y - startPos.y);
  
                      if (swipeValue &gt; 0){//up swipe
  
                          instruction.text="UP";
                      }   
                      else if (swipeValue &lt; 0){//down swipe
  
                          instruction.text="DOWN";
                      }
                  }
              }
          #endif
          }
      }
  </code></pre>
  
  <p>It is not working and I cannot understand why? Any help please?</p>