With simple touch and hold for a second or two I am getting TouchPhase.Moved and Ended but about 1/3rd of all touches are missing the Began!
private void OnEnable()
{
EnhancedTouchSupport.Enable();
}
private void OnDisable()
{
EnhancedTouchSupport.Disable();
}
void Update()
{
touchCount = Touch.activeTouches.Count;
if (touchCount == 1)
{
touch0 = Touch.activeTouches[0];
switch (touch0.phase) //first touch
{
case TouchPhase.Began:
Debug.Log("ONE TOUCH BEGAN at " + touch0.screenPosition);
break;
case TouchPhase.Moved:
Debug.Log("ONE TOUCH MOVED at " + touch0.screenPosition);
break;
case TouchPhase.Canceled:
Debug.Log("ONE TOUCH CANCELED at " + touch0.screenPosition);
break;
case TouchPhase.Ended:
Debug.Log("ONE TOUCH ENDED at " + touch0.screenPosition);
break;
}
}
else if (touchCount == 2)
{
Debug.Log("TWO TOUCHES");
}
}
This was tested on a Samsung Galaxy A21s.
Any ideas? Is this a bug or am I doing something wrong?
Just tested on an old Nexus 7 and touches seem to be working OK on that (but Audio not - but that is another thread).