title: Player Jumps but does not come back down
body: <p>Im trying to make a simple fps in unity although im currently getting an error with jumping. The player on the scene jumps but does not come back down at all. </p>
  
  <p>When I hit spacebar the player disappears off the scene. What am I doing wrong with in this code? </p>
  
  <pre><code>public class PlayerMovement : MonoBehaviour 
  {
      public float speed = 6f;
      public float gravity = 9.8f;   
      public float JumpForce = 0.01f;
      public GameObject bullet;
      public CapsuleCollider col;
      public LayerMask groundLayers;
  
      private Rigidbody rb;
      private CharacterController _charCont;
      private Vector3 moveDirection = Vector3.zero;
  
      private void Start () 
      {
          _charCont = GetComponent&lt;CharacterController&gt;();
          col = GetComponent&lt;CapsuleCollider&gt;();
      }
  
      private void Update()
      {
          float deltaX = Input.GetAxis("Horizontal") * speed; // Get the inputs from 
          float deltaY = Input.GetAxis("Vertical") * speed;
          var Movement = new Vector3(deltaX, 0, deltaY);
          Movement     = Vector3.ClampMagnitude(Movement, speed); // clamps speed so movement is always the same
          Movement.y   = gravity;     // sets gravity on y axis
  
          Movement *= Time.deltaTime; // fixes the movement so that its the same across different frame rates.
          Movement  = transform.TransformDirection(Movement);
          _charCont.Move(Movement);
  
          if (_charCont.isGrounded) // I believe im getting the error somewhere among these lines
              moveDirection.y ? Input.GetKeyDown(KeyCode.Space) : 0;          
          else moveDirection.y -= gravity * Time.deltaTime;
  
          _charCont.Move(moveDirection);
      }
  }
  </code></pre>
  
  <p>Any help would be much appreciated!</p>