Search code examples
unity-game-engineunity-uiui-toolkit

Touch is not working with Unity UI Toolkit buttons


I'm having a weird issue, may be a simple fix.

I've got a UI only "game" using the new UI Toolkit. It's a little kind of a drawing program. I've got a draw area in the middle with "tool buttons" on the sides. Everything works fine with Mouse, Pen, and touch when drawing (using scripts I can access all types of pointers), but for some reason touch doesn't work with the UI buttons only.

What's even weirder is that touch on UI buttons works when testing directly in Unity Play mode (I've got a touch screen laptop), but doesn't work when I make a Build.

In my Project Settings -> Input System Package, I've got Pen, Mouse, and Touchscreen active under "Supported Devices"

The new UI Toolkit is so new there's no help or similar issues I can find online.


Solution

  • Just a follow up since I ended up finding my answer somewhere else.

    In the "Input System UI Input Module" component in the EventSystem, I changed the "pointer Behavior" to "Single Unified Pointer" and that fixed it. Not sure if that's just a work-around, but it works great now.