title: How to make GameObject jump in Unity3D
body: <p>I have a 2d game, where GameObject (GO) moves to the right side on the floor. I want to make it jump. </p>
  
  <p>But when I add <strong>Character Controller</strong> to my GO and start simulation, it just fast move on the left side. Can't understand, what's wrong.</p>
  
  <p>GO also contain <strong>Rigidbody</strong> and <strong>Box Collider</strong></p>
  
  <pre><code>    public float jumpSpeed = 8.0f;
      public float gravity = 20.0f;
      private Vector3 moveDirection = Vector3.zero;
  
      void Start ()
      {
          player = (GameObject)this.gameObject;
      }
  
      void Update ()
      {
          // Move
          player.transform.position +=
              player.transform.right * speed * Time.deltaTime;
  
          // Jump    
          CharacterController controller = GetComponent&lt;CharacterController&gt;();
          if (controller.isGrounded)
          {
              moveDirection = new Vector3(Input.GetAxis("Horizontal"), 0,
                                          Input.GetAxis("Vertical"));
              moveDirection = transform.TransformDirection(moveDirection);
              moveDirection *= speed;
  
              if(Input.GetKey(KeyCode.Space))
                  moveDirection.y = jumpSpeed;
          }
  
          moveDirection.y -= gravity * Time.deltaTime;
          controller.Move (moveDirection * Time.deltaTime);
      }
  </code></pre>