Throwing Objects With A Stable Camera

There are a lot of tutorials for throwing objects in a fps game (for example:

)

However, these tutorials are for throwing the object in the direction the camera is looking. But, my camera is stable and it always looks forward. I want to throw objects to the direction the user clicks.

Here is some part of a code I found online. This is for throwing in the direction the camera is looking:

private void Throw()
{
    readyToThrow = false;

    // instantiate object to throw
    GameObject projectile = Instantiate(objectToThrow, attackPoint.position, cam.rotation);

    // get rigidbody component
    Rigidbody projectileRb = projectile.GetComponent<Rigidbody>();

    // calculate direction
    Vector3 forceDirection = cam.transform.forward;

    RaycastHit hit;

    if(Physics.Raycast(cam.position, cam.forward, out hit, 500f))
    {
        forceDirection = (hit.point - attackPoint.position).normalized;
    }

    // add force
    Vector3 forceToAdd = forceDirection * throwForce + transform.up * throwUpwardForce;

    projectileRb.AddForce(forceToAdd, ForceMode.Impulse);

    totalThrows--;

    // implement throwCooldown
    Invoke(nameof(ResetThrow), throwCooldown);
}

Probably all I have to do is to change here: Vector3 forceDirection = cam.transform.forward;

But I don’t know how i can give the positions of which way the user clicks

    void Throw()
    {
        if (Time.time<throwTime)
            return;
        throwTime=Time.time+throwCoolDown;
        Ray ray=Camera.main.ScreenPointToRay(Input.mousePosition);
        GameObject projectile = Instantiate(objectToThrow, ray.origin+ray.direction*0.5f, transform.rotation);
        Rigidbody projectileRb = projectile.GetComponent<Rigidbody>();
        projectileRb.AddForce(ray.direction*throwForce, ForceMode.Impulse);
    }

Thank you very much! It helped a lot. The throwing angle is not exactly what I want but I can handle after this, thank you