Touch problem


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 the 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.

I suggest using GUI

so …

function OnGUI(){
if(GUI.Button(new Rect(0,0,10,10),"Jump"){
if(GUI.Button(new Rect(20,0,10,10),"Move"){


You can create different controls by visiting The Unity Scripting Reference