- Home /
Question by
twoface262 · Jul 28, 2012 at 05:03 AM ·
androidjavascript
Android Multitouch
I'm having a ton of problems with my multitouch thingy for android. Here is what I've gotten.
for (var i = 0; i < Input.touchCount; ++i) {
var touch = Input.GetTouch(i);
if(fid == -1) fid = touch.fingerId;
if(touch.fingerId == fid){
if(((touch.phase == TouchPhase.Moved)|| (touch.phase == TouchPhase.Stationary))&& ( touch.position.x >= Screen.width /2 )){
transform.Rotate(Vector3(0,Input.GetAxis("Mouse X") * 10,0));
cam.Rotate(Vector3(Input.GetAxis("Mouse Y") * -10,0,0));
}
}
var touch2 = Input.GetTouch(i);
if(fid2 == -1) fid2 = touch2.fingerId;
if(touch.fingerId == fid2){
if(((touch2.phase == TouchPhase.Moved)|| (touch2.phase == TouchPhase.Stationary))&& ( touch2.position.x <= Screen.width /2 )){
transform.Translate(Vector3(Input.GetAxis("Mouse X") * 0.2,0,Input.GetAxis("Mouse Y") * 0.2));
}
}
}
}
I think I might be looping it wrong. Any ideas?
Comment
Your answer
Follow this Question
Related Questions
Spawning random terrain pieces 1 Answer
About ListItems in Unity3D 1 Answer
Load function not working propperly? 1 Answer
Loading from multiple files? 2 Answers
Object deformation on activat 0 Answers