In the most recent build of my iOS/Android app, after releasing it to my beta testers they reported that the app was “frozen” on iOS. I suspected that it wasn’t actually frozen, but rather wasn’t responding to any touches. I tested it by adding a TMP_Text that shows the elapsed time and some simple debug info about the current touch:
float time = Time.time;
tempDebugTextComponent.text = time + " ";
if (Input.touchCount > 0) {
Touch touch = Input.GetTouch(0);
Vector2 position = touch.position;
if (position == null) {
tempDebugTextComponent.text += "NO TOUCH";
} else {
tempDebugTextComponent.text += touch.position.x + " " + touch.position.y;
}
}
On Android, touches continue to work fine, and I indeed see the position of the touch when I touch the screen.
On iOS, the timer counts up, but I get no debug info about touches, so it looks like Input.touchCount
is always 0.
Does anybody have any ideas why touch would be ignored on iOS even though it continues to work fine on Android? Are there any sort of OS-specific touch settings I might have messed up in the editor?