title: Detect swipe gesture direction
body: <p>That is my code to try and simulate a swipe gesture so when I build to mobile I know it will work. Nothing is being logged and I am confused on why it seems to not work. I want it to print out in the console that I either swiped <code>RTL</code> (Right to Left) or <code>LTR</code> (Left to right). I do not see what I am doing wrong.</p>
  
  <pre><code>void Update()
  {
      if (Input.GetMouseButtonDown(0))
      {
          startPosition = Camera.main.ScreenToWorldPoint(Input.mousePosition);
      }
      if (Input.GetMouseButtonUp(0))
      {
          endPosition = Camera.main.ScreenToWorldPoint(Input.mousePosition);
      }
  
      if (startPosition != endPosition &amp;&amp; startPosition != Vector3.zero &amp;&amp; endPosition != Vector3.zero)
      {
          float deltaX = endPosition.x - startPosition.x;
          float deltaY = endPosition.y - startPosition.y;
          if ((deltaX &gt; 5.0f || deltaX &lt; -5.0f) &amp;&amp; (deltaY &gt;= -1.0f || deltaY &lt;= 1.0f))
          {
              if (startPosition.x &lt; endPosition.x)
              {
                  print("LTR");
              }
              else
              {
                  print("RTL");
              }
          }
          startPosition = endPosition = Vector3.zero;
      }
  }
  </code></pre>