My character cant jump in unity with my character controller,My character cant jump at all

Guys my character cant jump in unity with my character controller… I’ve checked the axes. I’m really new to unity so i don’t know anything XD. I was following a brakeys tutorial and everything other than the jump worked soo. any of u guys got an answer?? This is my code.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerMovement : MonoBehaviour
{
  public float gravity = -9.18f;
  public Transform GroundCheck;
  public float groundDistancce = 0.4f;
  public LayerMask groundMask;
  public float JumpHeight = 3f;
  Vector3  velocity;

  bool isgrounded;

  public CharacterController controller;

  public float speed = 12f;
      // Update is called once per frame
    void Update()
    {
      isgrounded  = Physics.CheckSphere(GroundCheck.position , groundDistancce, groundMask);

      if (isgrounded && velocity.y >= 0)
      {
        velocity.y = -2f;
      }

        float x = Input.GetAxis("Horizontal");
        float z = Input.GetAxis("Vertical");
        Vector3 move = transform.right * x + transform.forward * z;

        controller.Move(move * speed * Time.deltaTime);
        velocity.y += gravity * Time.deltaTime;
        controller.Move(velocity * Time.deltaTime);

        if(Input.GetButtonDown("Jump") && isgrounded)
        {
          velocity.y = Mathf.Sqrt(JumpHeight * -2f * gravity);
        }


    }
}
,Guys i cant jump in unity.. I'm pretty new so I followed a brakeys tutorial and vie made this code.. But my character cant jump at all.. I've checked the input axes.. Everything is untouched. Can any of you guys got an answer?? This is my code.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerMovement : MonoBehaviour
{
  public float gravity = -9.18f;
  public Transform GroundCheck;
  public float groundDistancce = 0.4f;
  public LayerMask groundMask;
  public float JumpHeight = 3f;
  Vector3  velocity;

  bool isgrounded;

  public CharacterController controller;

  public float speed = 12f;
      // Update is called once per frame
    void Update()
    {
      isgrounded  = Physics.CheckSphere(GroundCheck.position , groundDistancce, groundMask);

      if (isgrounded && velocity.y >= 0)
      {
        velocity.y = -2f;
      }

        float x = Input.GetAxis("Horizontal");
        float z = Input.GetAxis("Vertical");
        Vector3 move = transform.right * x + transform.forward * z;

        controller.Move(move * speed * Time.deltaTime);
        velocity.y += gravity * Time.deltaTime;
        controller.Move(velocity * Time.deltaTime);

        if(Input.GetButtonDown("Jump") && isgrounded)
        {
          velocity.y = Mathf.Sqrt(JumpHeight * -2f * gravity);
        }


    }
}

Time to do some debugging. I would first remove the " && is grounded" part from the Input.GetButtonDown(“Jump”) to see if there is an issue with grounded detection.

If it works with removing that line, then check did you assign groundMask to Default or whatever layer it is supposed to jump with? Is Groundcheck at the bottom of the feet of your character?

If it doesn’t work with removing isgrounded, then perhaps your input is not set to “Jump” correctly.