Jumping cancelled out somehow?

Not exactly sure what is wrong here, the Jump function returns the correct value, but the gravity seems to be applied way too fast, adding by the 100s. I didn’t apply gravity more than once, I’ve been doing unity for about a year and a half, not exactly sure what’s causing this, as its basically copy pasted from one of my other projects that worked fine. The only thing I did was clean it up a bit and implement double jumping.

If someone with a keener eye than me can point out what’s missing or repeated for me, it would be much appreciated

Here is the code:

public class PlayerMovement : MonoBehaviour
    public float groundSpeed = 12f;
    public float groundAcceleration = 2f;
    public float airAcceleration = .5f;
    public float airSpeed = 10f;
    public float gravity = 12f;
    public float jumpHeight = 3f;
    public float airJumpHeight = 2f;
    public int airJumpMax = 3;

    public float groundDistance = 1.05f;

    int airJumps;
    bool isGrounded = false;
    Vector3 velocity;
    CharacterController controller;

    void Start()
        airJumps = airJumpMax;
        controller = GetComponent<CharacterController>();

    void Update()
        isGrounded = Physics.Raycast(transform.position, Vector3.down, groundDistance);
        if (isGrounded == true)
            velocity.y = 0f;
            velocity = GetVelocity(groundSpeed, groundAcceleration);
            if (Input.GetButtonDown("Jump"))
                velocity.y = Jump(jumpHeight);
            airJumps = airJumpMax;
            velocity.y -= gravity;
            velocity = GetVelocity(airSpeed, airAcceleration);
            if (Input.GetButtonDown("Jump") && airJumps > 0)
                velocity.y = Jump(airJumpHeight);

        controller.Move(velocity * Time.deltaTime);

    private Vector3 GetVelocity(float speed, float acceleration)
        float x = Input.GetAxis("Horizontal");
        float z = Input.GetAxis("Vertical");

        Vector3 targetVelocity = transform.right * x + transform.forward * z;
        targetVelocity = targetVelocity * speed;
        targetVelocity.y = velocity.y;

        Vector3 move = Vector3.MoveTowards(velocity, targetVelocity, acceleration);

        return move;

    private float Jump(float jumpH)
        float jump = Mathf.Sqrt(2 * jumpH * gravity);
        return jump;

Fixed the problem, I had forgotten I had removed the time.deltatime that was applied to the gravity, as the equation to calculate the jump height required gravity to have deltatime applied twice.