In the editor IsPointerOverGameObject() works fine and returns true when it should, except when the position of the touch is the same next touch, then it returns false!
If the position of the touch is changed it works fine again.
case TouchPhase.Began: //new touch 0
joystick.DoActivate(touch0.screenPosition);
isOverUI = EventSystem.current.IsPointerOverGameObject(touch0.touchId);
Debug.Log(isOverUI);
break;
I am simulating the touches using the mouse (if this is relevant) using such as:
InputSystem.QueueStateEvent(touchScreen, new TouchState { phase = TouchPhase.Began, touchId = 1, position Mouse.current.position.ReadValue()});
Difficult to test on android build as it is difficult to get two real touches at the same position.
Any ideas?