Touch positions

I would like to make an object appear at the position which im touching the screen.
I have a camera which can turn, and would like to make it possible for the object to appear in any directon at the place in which the screen is touched.

I tried screentoviewportpoint but it makes the object appear the same place regardles of which way the camera is facing. Is there another way?

ScreenToViewportPoint should work, but there is an extra step you must use. Once you have got the viewport point and set its Z coordinate to the appropriate distance from the camera, convert it back to world space with ViewportToWorldPoint:-

var tempPt = Camera.main.ScreenToViewportPoint(Input.mousePosition);
tempPt.z = <whatever>;
var actualPt = Camera.main.ViewportToWorldPoint(tempPt);