TouchId with the new Input System

Ok, so I have a mapping setup that works with Mouse Left Click and Touch. When either hits the screen it then checks to see if it is over a UI and then runs no further.

The mouse side of it works fine, and the issue I am now running into is that the touch ide side of it doesn’t work and I am at a loss to find how to do this.

In the old way you would do something like this.

        foreach (Touch touch in Input.touches)
        {
            int id = touch.fingerId;
            if (EventSystem.current.IsPointerOverGameObject(id))
            {
                return;
            }
        }

The mapping for both the left and Primary Touch is set to Button for the Action Type.

1 Like

I take it nobody knows how to do this.

The binding is a button with two options Left Mouse Click and Touch */Press (this might not be right), so basically I want to check if the touch is over a UI, I can do the mouse easy enough but there is little to no explanation of guides how to do this with

public void OnClick(InputAction.CallbackContext context)
{
}

Sorry for necroing, it’s the first post that shows up on google when searching for this.
Were you able to find a solution? I also use the new input system and need to check if a touch happened over UI or not.

No, sadly I did not.