Jumping Not Ever Time I Hit The Space Bar

when i hit the space bar my player jumps but he don’t not jump sometime’s is this a bug or something here is the script

public class PlayerJump : MonoBehaviour {

public float jumpSpeed = 15;
public float gravity = 16;
CharacterController controller;
Vector3 currentMovement;

// Use this for initialization
void Start () 
{
	controller = GetComponent<CharacterController>();
}

// Update is called once per frame
void Update () 
{
	if (!controller.isGrounded)
		currentMovement -= new Vector3 (0, gravity * Time.deltaTime, 0);
	else
		currentMovement.y = 0;
	
	if (controller.isGrounded && Input.GetButtonDown("Jump")) 
		currentMovement.y = jumpSpeed;
	
	controller.Move (currentMovement * Time.deltaTime);
}

Check your player’s and the thing that you are jumping on’s collider. I guess your player’s collider is too big for your player so you don’t feel its grounded but in fact it is grounded.