Hi,
Currently I handle touch and mouse movement using these handlers:
IPointerDownHandler, IBeginDragHandler, IDragHandler, IEndDragHandler, IPointerUpHandler
When the user interacts with the screen I save the positions as seen below and then use these position variables later by other functions:
void OnDrag(PointerEventData eventData) {
eventData_Screen = eventData.position;
eventDataX_Screen = eventData.position.x;
eventDataY_Screen = eventData.position.y;
}
How could I completely ignore every touch apart from the first one?
I tried using Input.touchCount == 1 like this:
void OnDrag(PointerEventData eventData) {
if (Input.touchCount == 1) {
eventData_Screen = eventData.position;
eventDataX_Screen = eventData.position.x;
eventDataY_Screen = eventData.position.y;
}
}
but there are several problems with this:
- it doesn’t work with mouse like this
- when the second touch is received it disables the first touch’s movement too
I’m searching for a way to completely ignore the second touch and follow the first touch like nothing happened and like the second touch wouldn’t even exist.
Do you have any ideas how could this be achieved?
Thanks.