- Home /
Duplicate Question
Sprite Touch and Drag in 2dToolkit
Hi, I make one simple 2d game using 2d toolkit. In my game i add many sprite in my play scene and that all using single script. In this game i want to move sprite by touch event. when i touch any sprite how to find which sprite touch?
Thanks in advance.
Down-voited because this is answered in the documentation.
Answer by Graham-Dunnett · Apr 08, 2013 at 10:09 AM
http://docs.unity3d.com/Documentation/ScriptReference/Input.GetTouch.html
Look at the first example, which shows "Moves object according to finger movement on the screen".
thnx for ans
sry for my weak English.
i make game in 2d toolkit.
but my que is for example 100 sprites on my scene then which sprite touch that how can find.
i also try raycast but that didn't work in sprite but working unity object.
Ahh !!
definitely consider the 2dToolkit forum, it is great
http://2dtoolkit.com/forum/index.php
you will get a full answer quickly
Also, you could even email the 2DToolkit guys, they are great
Also consider this long answer about using a POOL ...
http://answers.unity3d.com/questions/321762/how-to-assign-variable-to-a-prefabs-child.html