Why is my float not fitting into my AddForce script?

I’m really new to Unity, and I’m trying to make a 2d platform script with the little knowledge I have. I made a script for jumping, but there’s a problem. Here’s my code:

    public float jumpHeight;
    bool jumping = false;
    public Rigidbody2D rb;
    
    void Update()
    {
        if (Input.GetKey("w"))
        {
            if (jumping == false)
            {
                rb.AddForce(0, jumpHeight);
                jumping = true;
            }
        }

    }
    void OnCollisionEnter2D(Collision2D collisionInfo)
    {
        if (collisionInfo.collider.tag == "Platform")
        {
            jumping = false;
        }
    }

When I try this, I get an error message that tells me it can’t convert a float to a Vector2, even though I put (0, jumpHeight) and not (jumpHeight).

My workaround was this:

    public Vector2 jumpHeight;
    bool jumping = false;
    public Rigidbody2D rb;
    
    void Update()
    {
        if (Input.GetKey("w"))
        {
            if (jumping == false)
            {
                rb.AddForce(jumpHeight);
                jumping = true;
            }
        }

    }
    void OnCollisionEnter2D(Collision2D collisionInfo)
    {
        if (collisionInfo.collider.tag == "Platform")
        {
            jumping = false;
        }
    }

That works, but it isn’t very practical, and I’m sure there’s a much better way to do it.

I followed a Brackeys tutorial (for a 3d project) and he said to use the float inside of the vector to move left and right, and that works without a problem. What’s the difference here?

Instead of (0, jumpHeight) use new Vector2(0, jumpHeight).