How to spawn cubes on mouse position

Hello i use this code to spawn cubes but they spawn next to the cube i attached the rigidbody so i want they to spawn on mouse position :

   using UnityEngine;
   using System.Collections;

 public class IfClose : MonoBehaviour {
     public bool Gravitronned;
     public Rigidbody projectile;
     // Use this for initialization
     void Start () {
 
     }
 
     // Update is called once per frame
     void Update () {
         RaycastHit hit;
         if (Input.GetKeyDown (KeyCode.F)){
             Rigidbody clone;
             clone = Instantiate(projectile, transform.position, transform.rotation) as Rigidbody;
             clone.velocity = transform.TransformDirection(Vector3.forward * 10);
             }
         }
     }

Vector3 pos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
You may want to change z value for pos too.

Now that you have screen position, Instantiate your prefab at that position.