touch problem in unity

hi,

currently I’m working on small project,

what i want here when i touch the screen character move when i touch specific game object (as button ) character should jump.

i have completed both the thinks, but the problem I’m facing currently when i touch Game object its calculate the screen touch also, because of that my character move’s also with jump.

is there is any possibility that when i touch the game object it’s should not calculate as screen touch, so my character only jump when we touch game object.

thanks in advance…

Find a tutorial or post on how to use raycast to detect that you are pointing at the GameObject (mesh probably) instead of scenery (there are plenty of these; just search for raycast).

checked with raycast, but is there any option in raycast that touch has ended. because what i want when object is touch animation is playing as we remove finger the animation should stop.

Your answer is here I think. In a “Mobile Input” section.

http://docs.unity3d.com/Documentation/Manual/Input.html