Multitouching on an Android device

I’ve made some guiTextures and all of them have a script attached to them.

These textures are actually areas (images) on the screen where the user can touch and make the character move, jump etc (like buttons).

The thing is that the user cannot jump and move simultaneously. If I touch the move forward button with one finger and then I select the jump button with the other finger, I will not get the OnMouseEnter function of the second texture.

Don’t use OnMouseEnter, it’s not optimized for multi-touch…

you can use Input.touches and GUIElement.HitTest, this is just one way…

try something like:

var myGUITexture : GUITexture;
var otherTexture : GUITexture;

function Update(){
    for(touch in Input.touches){
        if(myGUITexture.HitTest(touch.position)){
         //your code here
      }
        if(otherTexture.HitTest(touch.position)){
         //other textures code
      }
//...etc 
   }
}

for example

(this script could be on any object in the scene, then just set each variable to the proper texture…)