How to get mouse cursor in Vector3

I’m trying to make a script that gives Force to the object of position “X” in the direction of mouse cursor.

public Transform start;
public Vector3 end; //end = mouse cursot.
GetComponent<Rigidbody>().AddForce(end * speed);

Such as to shoot an arrow from a bow. Bow is the “start” and aim mouse cursor. I tried everything I found, but nothing Is returned the exact coordinates of the mouse in vector3.
In the first person is easy, but I can not do it in the third person.


 if (Input.GetButtonDown("Fire1"))
     RaycastHit hitInfo;
     Vector3 mousePos = Input.mousePosition;
     mousePos.z = 10; // select distance = 10 units from the camera

     if (Physics.Raycast (yourObject.position, mousePos, out hitInfo))
          GetComponent<Rigidbody>().AddForce(rayOrigin.direction * shotSpeed);