I am having a lot of trouble getting touches to be consistent on iOS. This code works about %90 of the time. The rest of the time the touch is ignored. Using just one finger. Code (csharp): var tapCount = Input.touchCount; for ( var i = 0 ; i < tapCount ; i++ ) { var touch = Input.GetTouch(i); if (touch.phase == TouchPhase.Began){ print ("touch y is " + touch.position.y); } }
Yes, in Update(). I didn't check the framerate. With it in Update() any touches should get detected shouldn't they?
And this is on the actual device? Note that Unity Remote sometimes misses touches that don't cause problems on the actual device.
I've always had issues with touch.phase and only get solid touch / swipe recognition when I manually track touches through Input.GetTouch() But that might just be me.
Your code should not rely on TouchPhase.Began phase, because if your framerate is low and touch is quick (read starts and ends on the same frame) then only TouchPhase.Ended will be reported.