Instantiate object at mouse position

Hey y’all, so ive taken a look around for a couple hours now and I have yet to find something here that works. It could be just my dumb brain trying to figure it out, so i have included here a video so that I can get better help. The Video

also here is the code from the video

void Update ()

       Debug.Log ("the player has " + currency);
	   if (Input.GetMouseButtonDown(1))
		Vector3 mousePos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
		mousePos.y = 0.4f;
		if (eMine)
			if (currency >= 10)
				//RaycastHit hit;
				//if (collider.Raycast(ray, out hit, 100)) 

					//	Debug.DrawLine(ray.origin, hit.point);
				//	}
				currency -= 10;
				//mousePos.z =25.0f;
            //Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
            //RaycastHit hit=new RaycastHit();
						 Instantiate(eMinePrefab,mousePos, Quaternion.identity);

Before passing a point to ScreenToWorldPoint(), you must set the ‘z’ parameter to the distance in front of the camera. If you don’t, ‘z’ will be zero and the function will just return the position of the camera rather than a position in front of the camera. So

Vector3 v3 = mousePos;
v3.z = 10.0f;
v3 = Camera.main.ScreenToWorldPoint(v3);

These lines will find the world position 10 units in front of the camera at the mouse position.