How to instantiate an object by touching

I would like to know how to instantiate an object by touching a screen on a mobile device.

Hi,

You can simply use the Instantiate command, on a mouseDown event (Input.GetMouseDown(0)) since tapping is the mobile equivalent of left click. Then simply instantiate the desired object at the mouse position, if that’s what you want, which can be done with .

Camera.main.ScreenPointToRay(Input.mousePosition); 

Alternatively you could also use a ray, to check for collisions, see:

http://answers.unity3d.com/questions/491711/getting-the-position-of-the-mouse-in-2d-space.html

Hope that helped :slight_smile:

IEMatrixGuy