I have created a game in for web which works with OnMouseDown. I have just got my Android Licence and now converting it to Android.
Is there a function similar to OnMouseDown but for OnTouch?
The code I am trying is on a GUITexture.
Its picking up the fact there has been a touch and it moves on but I have another GUITexture with
But no matter where I click its always doing the credits instead of the GUITexture I am touching.
Any help would be appreciated. Thanks
GUITexture has a pretty nice function, .HitTest which you can use to test if the found touch is within the rect of the GUITexture.
Normally you would use something like
This is written from head so not granted it works
answered Jun 29 '11 at 02:26 AM
thats because you don't check if the touch is over the GUITexture at all. you code only checks if there is a touch.
there is no OnTouch or alike, you have to do the hittest manually or a raycast
answered Jun 29 '11 at 02:11 AM