ok i have a really simple question from which i cant seem to get an answer. all i want is to be able to detect touch on a certain spot on the screen, like a gui for example.
so far i have came up with a few things but dont work efficiantly so i need an answer to solve this little puzle…all i want to be able to do is touch on one gui and touch on another gui at the same time shouldnt be to difficult should it.
ok so i managed to find out what is wrong with my code
var count : float = 0;
function Update (){
for (var i = 0; i < Input.touchCount; ++i)
var touch : Touch = Input.GetTouch(i);
if (touch.phase == TouchPhase.Stationary && guiTexture.HitTest(touch.position)){
count = count +1;
print(count);
}
}
this will not allow duel touch however after a bit of research and a lot of fiddling i have found that this code will work for detecting touch on gui…
var count : float = 0;
function Update (){
for (var i = 0; i < Input.touchCount; ++i){
var touch : Touch = Input.GetTouch(i);
if (touch.phase == TouchPhase.Stationary && guiTexture.HitTest(touch.position)){
count = count +1;
print(count);
}
}
}