- Home /
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.
Answer by Seth-Bergman · Mar 10, 2013 at 12:36 PM
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...)
Your answer
![](https://koobas.hobune.stream/wayback/20220613094140im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Two player touch screen 1 Answer
Multi touch support for Android devices 0 Answers
Differentiating between fingers in multitouch 1 Answer
How is the value in SystemInfo.deviceModel gathered? 0 Answers
FingerID problem 1 Answer