- Home /
Question by
Traczy · Jul 15, 2015 at 07:36 PM ·
c#objecttouchtouchcount
Do something only when finger is on object
How can i register only when the finger(touch) is on an object. I know this "if(Input.touchCount > 0)", but that makes the happening happend anywhere you press on the screen. Appreciate help!
Comment
Is there any reason you can't use the On$$anonymous$$ouseDown method? I'm pretty sure it can be used for touch as well nowadays... Remember to have w collider on the GameObject the script is attached to.
No, I can't use On$$anonymous$$ouseDown because then it moves one time each press then. It does not move over time when i hold my button down. @savlon
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
[Edited]-Android-swap position on touch 1 Answer
Objects seemingly not being instantiated after touch. 1 Answer