|
So I've been working with Unity Android for the past few weeks and have been struggling with one problem over and over and over again. I've gone through the documentation and even browsed through the Penelope scripts but I can't find a solution to this problem. I'm working on the Acer Iconia A200 and testing with a basic unity script: So the issue is this: it works perfectly when one finger is on the screen. When two fingers are on the screen it can't differentiate between the old finger and the new finger and so it averages the distance between the two. Additionally, it occasionally can't tell when a finger has been lifted from the screen and will read one finger as two. What is a good workaround to this? The penelope script referenced a concept called "latching". How can I implement this? Thanks in advance. EDITED TO ADD NEWER/LONGER VERSION OF THE CODE function Update(){ } The script basically moves a target named "MoveTarget" to a place in the world, designated by the player's finger touching the screen. Then the script Lerps the Ship model towards that target. Simple, but broken
(comments are locked)
|
|
Ok so firstly you need to move the moveRay and ClickRay construction inside the for loop where MoveFinger is being updated. I'm guessing it's just taking the wrong finger position and you will need to create a new ray for each finger, inside that loop. Yep, that did it lol. Thanks so much for your help and your patience, Mike
Jun 13 '12 at 08:13 PM
Steveosaurous
(comments are locked)
|
|
Okay, so I'm using Unity remote now for my debugging. I've been tracking my finger id's and they seem to be working properly. When I put one finger on the screen, the number is 0, a second finger is 1, 2, 3 and so on. Now, how would I use fingerId to continuously track the same one finger? I'm just unsure how to implement the code still.
(comments are locked)
|

I don't see move ray defined there, what is it?
//var moveray = Camera.main.ScreenPointToRay (Input.GetTouch(MoveFinger).position);
get a finger Id and use that in if condition.
how do I do that?
Are we missing some code, because the current example looks like it only handles the Began event?