- Home /
Double tap on iPhone very unreliable
I'm using the following code (Unity 3 Pro & Unity iPhone Pro):
var doubleTap : int;
function Update() {
if(Input.GetTouch(0).tapCount>=2) {
if (Input.GetTouch(0).phase==TouchPhase.Began) {
doubleTap++;
}
}
}
Running it from the editor using Unity iPhone remote for Unity 3, I can see the doubleTap figure rise when I double tap. However the double tap detection is very unreliable, with only a roughly 60% detection rate. Is this because I'm running it through the remote process? I haven't yet tried to put a standalone build onto my device. Alternatively, is there something wrong with my code?
Answer by Jean-Fabre · Jan 27, 2011 at 12:08 PM
Hi,
Yes, Unity remote is not suppose to check for performance and is not reliable for accurate user inputs, this will work 100% better when built and running normally on the iphone itself.
Bye,
Jean
Hey I am getting following error UnityException: Index out of bounds. testlearning.Update () (at Assets/testlearning.cs:55)
Answer by Mantas-Puida · Feb 25, 2011 at 03:01 PM
Input.GetTouch(0).phase==TouchPhase.Began
Very short touches that take less than one frame will skip TouchPhase.Began and will reported as TouchPhase.Ended.