How to find the position of the touch on an android device?

Hi guys,
I’m working to develop an android game. I want to insert an object to the game when the user touches the screen. The object must be inserted to the position where the user touches.

I can implement this if I find the position of the touch (which I don’t know how to find). I’m working in 3D project. But its not a big deal to set a constant ‘z’ position to a vector3 variable and transform my object into the required position which is outside the screen by default.

So, the only problem is I need the (x,y) co-ordinates where the user touches. Please give me a simple C# script to find the position of the touch from which I can script myself.

Thank you in advance.

If you’re using orthographic camera, something like this will do :

Vector3 touchPos = Camera.main.ScreenToWorldPoint(Input.GetTouch(0));
Instantiate(myPrefab, touchPos, Quaternion.identity);