So, my understanding is that, although multitouch Unity UI works out of the box on mobile platforms, that is not the case with Windows. I’ve been having a hard time figuring out how to work around this Unity limitation and was wondering if anyone else has successfully done this.
I hear that TouchScript is the best solution for handling multitouch on Windows, the problem is just that it’s not integrated with the UI event system. So, it seems like the way to do it would be with TouchScript and some kind of new Input Module that would forward TouchScript events to Unity’s built-in Event System.
Does that sound right? Does anyone have a different solution?
That sounds about right, though instead of making a new input module to work with unity’s event system, I made my own class for anything in the UI that you want to interact with your touch.
To make a button, all you need is a UI.Image with a collider, a touchscript gesture attached, and a script that runs a function when you touch the button. You can even go farther and make the image change when you press/release it, or go even crazier and give the script a delegate so it can be reused like the normal UI.Button.
My point is you can use touchscript and it won’t be too difficult to make your own versions of the UI elements you need.
Note: When you import touchscript, you’ll have to go into the packages folder and extract the windows 7 and windows 8 packages!
I haven’t tried it yet (it’s on my to-do list), but this TouchScriptInputModule.cs supposedly integrates TouchScript with the new EventSystem, thereby passing touch events to the new UI system.
1 Like
Nice! I had a feeling somebody would have already done this.
I will definitely be giving this a try in the next day or so.