Hello. I have GUITexture working as touch button.
for (var touch : Touch in Input.touches)
{
if (myButton.HitTest(touch.position))
{
if(touch.phase == TouchPhase.Began) { /* do stuff */ }
if(touch.phase == TouchPhase.Ended) { /* stop doing */ }
}
}
The button works as it should when I press it, and then let go.
But the problem is that if I begin touching the button, and then slide my finger off the button and let go the finger somewhere else, it is still “doing stuff”, but I want it to stop doing it.
I have also tried other touchPhases, but nothing seem to work.
Any help would be appreciated a lot, thanks in advance.