title: C# and Unity3D while key is being pressed
body: <p>I am very new to C#. I am creating something in Unity to help me learn C# and Unity better.</p>
  
  <p>I want to know why:</p>
  
  <pre><code>Input.GetKeyDown(KeyCode.UpArrow))
  </code></pre>
  
  <p>Only fires once when placed within:</p>
  
  <pre><code>void Update()
  </code></pre>
  
  <p>Since update is a loop, why is it not fired while I hold the key down (in my case causing a sphere to move)?</p>
  
  <p>I have managed to get it working by using two bools that are altered when the key is pressed and released.</p>
  
  <p>Here is my full script that I am playing with to move a sphere and simulate acceleration/deceleration:</p>
  
  <pre><code>using UnityEngine;
  using System.Collections;
  
  public class sphereDriver : MonoBehaviour {
  int x ;
  bool upPressed = false ;
  bool downPressed = false ;
  void Start()
  {
      x = 0 ;
  }
  
  void Update ()
  {
      if(x &gt; 0) {
          x -= 1 ;
      }
      if(x &lt; 0) {
          x += 1 ;
      }
      if(Input.GetKeyDown(KeyCode.UpArrow))
      {
          upPressed = true ;
      }
      else if(Input.GetKeyUp(KeyCode.UpArrow))
      {
          upPressed = false ;
      }
  
      if(upPressed == true)
      {
          x += 5  ;
      }
  
      if(Input.GetKeyDown(KeyCode.DownArrow))
      {
          downPressed = true ;
      }
      else if(Input.GetKeyUp(KeyCode.DownArrow))
      {
          downPressed = false ;
      }
  
      if(downPressed == true)
      {
          x -= 5  ;
      }
  
      transform.Translate(x * Time.deltaTime/10, 0, 0) ;
  }
  
  }
  </code></pre>