Error: Cannot Convert from float to unity Engine.Vector 3

Hi im trying to make a gun that shoots but this error came up and im not sure how to fix it

Assets\Scripts\weapon.cs(39,134): error CS1503: Argument 1: cannot convert from 'float' to 'UnityEngine.Vector3'

this is my script

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

public class weapon : MonoBehaviour
{

    public float fireRate = 0;
    public float Damage = 10;
    public LayerMask NotTohit;
    private float timeToFire = 0;
    Transform firePoint;

    // Start is called before the first frame update
    void Awake()
    {
        firePoint = transform.Find ("FirePoint");
        if (firePoint == null) {
            Debug.LogError("No firePoint WHAT!!!");
        }
    }

    // Update is called once per frame
    void Update()
    {
        if (fireRate == 0) {
            if (Input.GetButtonDown("ShootMain")) {
                Shoot () ;
            }
        }else if (fireRate != 0) {
            if (Input.GetButton("ShootMain")&& Time.time > timeToFire) {
                timeToFire = Time.time + 1 / fireRate;
                Shoot() ;
            }
        }
    }

    void Shoot() {
        Vector2 mousePosition = new Vector2 (Camera.main.ScreenToWorldPoint (Input.mousePosition).x, Camera.main.ScreenToWorldPoint (Input.mousePosition.y));
        Vector2 firePointPosition = new Vector2 (firePoint.position.x, firePoint.position.y);
        RaycastHit2D hit = Physics2D.Raycast (firePointPosition, mousePosition = firePointPosition, 100, NotTohit);
        Debug.DrawLine (firePointPosition, mousePosition);
    }

}

The problem is this line:

        Vector2 mousePosition = new Vector2 (Camera.main.ScreenToWorldPoint (Input.mousePosition).x, Camera.main.ScreenToWorldPoint (Input.mousePosition.y));

The first thing is that you have “.y” and “)” mixed up towards the end of the line. ScreenToWorldPoint takes a Vector3, but as written here, you’re sending it a single number, the mouse’s “y”. the “y” ought to be on the outside of one of the parentheses; That’s the error message.

But this is a lot of unneeded complexity, not to mention more than a little wasted calculation (as written it does the ScreenToWorldPoint math twice and discards the unused numbers each time), and it should be simply:

Vector2 mousePosition = Camera.main.ScreenToWorldPoint(Input.mousePosition);