title: Basic C# Unity2D movement script not functioning
body: <p>Hi there fellow Overflowers!
  I have recently dived into C# in Unity, because I believe that it has more functionality than UnityScript, and I come from a C++ background. Referencing some code from a 2D script in the Sample Assets, I have tried to create my own. The code is below:</p>
  
  <pre><code>    using UnityEngine;
  
  public class PlayerControl : MonoBehaviour {
  //Variables
      [HideInInspector]
      public bool facingForward = true; //for Flip() Function
      bool isGround = true; //for Grounded() Function
      public float maxSpeed = 5.0f; //Terminal sideways velocity
      public float HorizonAxis; //Checks for a/d movement 
      public float jumpFloat = 1000.0f; //Modular, use Unity Editor
      public float moveFloat = 400.0f; // "                       "
  
      void Start() {
  
          //transform.position(0,0,0);
  
      }
  
      void Flip() {
          facingForward = !facingForward; //switches boolean
          Vector3 theScale = transform.localScale; //assigns vector to localscale of Player
          theScale.x *= -1; //if x = 1, position becomes -1 and thus flips
          transform.localScale = theScale; //reassigns the localscale to update theScale
      }
      bool Grounded() {
          if (transform.position.y &gt; 1) { //if position of gameObject is greater that 1, not grounded
              isGround = false;
          } else {
              isGround = true;
          }
          return isGround; //function returns true or false for isGround
      }
  
      void Update() {
          HorizonAxis = /*UnityEngine.*/Input.GetAxis ("Horizontal"); //assigns HorizonAxis to a/d movement from UnityEngine.Input
          if (HorizonAxis * rigidbody2D.velocity.x &gt; maxSpeed) { // if Input a/d by current x velocity of gameObject is greater than maxSpeed             
          rigidbody2D.velocity = new Vector2 (Mathf.Sign (rigidbody2D.velocity.x) * maxSpeed, rigidbody2D.velocity.y); //1 or -1 times the max speed, depending on direction
      }
  
      else if (HorizonAxis * rigidbody2D.velocity.x &lt; maxSpeed) { //if Input a/d is less than terminal velocity
          rigidbody2D.AddForce(Vector2.right * HorizonAxis * moveFloat); //add force to the right equivilant to Input by scalar moveFloat
      }
          if (Input.GetButtonDown ("Jump")) { //If Space
              if(isGround) { //and isGround returns true
                  rigidbody2D.AddForce(new Vector2(0.0f, jumpFloat)); //add upwards force to bottom of rigidbody2D
                  isGround = false; //Resets isGround value
              }
          }
          if (HorizonAxis &gt; 0 &amp;&amp; !facingForward) {//if UnityEngine.Input is to the right and facing left
              Flip (); //execute
          }
          else if (HorizonAxis &lt; 0 &amp;&amp; facingForward) { //else
                      Flip (); //execute 
          }
  
      }
  }
  </code></pre>
  
  <p>Unfortunately, the code just doesn't work. I get no compile errors, but any Input does not effect the current position of the character. Should I be using transform.Translate to change the position, or stick with AddForce to a Vector2 until the character hits a maxSpeed?</p>
  
  <p>Thanks heaps :)</p>