- Home /
The question is answered, right answer was accepted
Android: After the third touch all touches get cancelled
I am using Unity Remote 5 with Unity 5.6.0f3 to debug some touch inputs from my mobile Android device with Android 6.0.1 like so:
using UnityEngine;
public class TouchInput : MonoBehaviour
{
private void Update()
{
int tapCount = Input.touchCount;
Debug.Log(tapCount);
for (int i = 0; i < tapCount; i++)
{
Touch touch = Input.GetTouch(i);
switch (touch.phase)
{
case TouchPhase.Began:
Debug.Log(touch.fingerId + " Began");
break;
case TouchPhase.Canceled:
Debug.Log(touch.fingerId + " Canceled");
break;
case TouchPhase.Ended:
Debug.Log(touch.fingerId + " Ended");
break;
case TouchPhase.Moved:
Debug.Log(touch.fingerId + " Moved");
break;
case TouchPhase.Stationary:
Debug.Log(touch.fingerId + " Stationary");
break;
}
}
}
}
The problem is that the first two touches get cancelled after I have more than two fingers down with the third touch not even getting registered.
I tried opening a new project and writing a fresh script for it, but it didn't solve the problem.
I even tried using TouchScript, but that wasn't working either.
Is that a common problem in Unity or am I doing something wrong?
Answer by fabianbehrendt · Aug 21, 2017 at 07:39 PM
It was a device specific setting. Since I'm using the OnePlus Two, you had to disable the screenshot feature, that lets you take screenshots with a swipe of three fingers. Disabling it helped me to get rid of the problem.
Follow this Question
Related Questions
Unity3d Get Cube Pressed On Mobile 1 Answer
Android 2D multitouch joystick + buttons 0 Answers
Two player touch screen 1 Answer
Two or more touchs at same time? 0 Answers
how to make rail and then make something move on it? 0 Answers