Unity Touch=2 commends?

Hi. I have problem. This is my simple script:

if(Input.touchCount==1&&guiTexture.HitTest(Input.mousePosition)&&may==true){
may=false;
belaK.SendMessage("Zb");
OP();
}
function OP(){
yield WaitForSeconds(0.2);
may=true;
}

The function ZB is here:

function Zb(){
if(may==false&&may2==true){
mesh.enabled=false;
Instantiate (build1, point.transform.position, point.transform.rotation);
}
}

And this ZB function create 1 build, but when i touch GuiTexture (to Send Message function Zb) function Zb create 2 builds. I don’t have any idea how fix it.

Maybe you know?

Thanks in advence :wink:

Does the player need to touch the texture/button with two fingers? if not you could only use Input.touchCount > 0

so then you should always use Input.GetTouch(0).phase == TouchPhase.Began (or .Ended whatever you need) because other ways it will call the function every frame in which the finger is down.

that should fix your problem