Reapa
1
Given the following inside “void Update()”:
Debug.Log("////START TOUCHLOG////");
foreach (var touch in UnityEngine.Input.touches)
{
Debug.Log("T" + touch.fingerId + ": " + touch.phase + ", " + touch.position);
}
Debug.Log("////END TOUCHLOG////");
Using 3 of my fingers not touching close to:
- Touch first finger
- Touch second finger elsewhere
- Touch third finger elsewhere
- Repeatably tap first and second finger on the same spot.
_
Can someone explain why these loggings occur:
A) Same touch ID appears twice?
_
B) No “end” event for T1. T2 becomes T1 next frame.
This issue occurs when building to WebGL and running on Windows 8 in chrome using the touch screen.
This issue does not occur when building to Windows and running on Windows 8 using the touch screen.
I also have this problem at coding a co op game with touch screen.
The touch id i changed every time a finger is released, so i had to check the fingerID in the touch data which doesn’t change.
1st Finger Pushed:
TouchID 0 | Finger ID 0
2nd Finger Pushed:
TouchID 0 | Finger ID 0 (1stFinger)
TouchID 1 | Finger ID 1 (2ndFinger)
3rd Finger Pushed:
TouchID 0 | Finger ID 0 (1stFinger)
TouchID 1 | Finger ID 1 (2ndFinger)
TouchID 2 | Finger ID 2 (3rdFinger)
releasing 2nd Finger:
TouchID 0 | Finger ID 0 (1stFinger)
TouchID 1 | Finger ID 2 (3rdFinger)
releasing 1st Finger:
TouchID 0 | Finger ID 2 (3rdFinger)
Input.GetTouch(TouchID).fingerId
as far as i can remember putting again a finger down the others are pushed back again like
new finger
TouchID 0 | Finger ID 0 (newFinger)
TouchID 1 | Finger ID 2 (3rdFinger)
new finger 2nd
TouchID 0 | Finger ID 0 (newFinger)
TouchID 1 | Finger ID 1 (2ndnewFinger)
TouchID 2 | Finger ID 2 (3rdFinger)
Reapa
3
Only problem is I was using finger ID, which shouldn’t change as you’ve mentioned.