Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Anyone successfully implement multitouch Unity UI on Windows 7/8?

Discussion in 'UGUI & TextMesh Pro' started by casimps1, Jul 21, 2015.

  1. casimps1

    casimps1

    Joined:
    Jul 28, 2012
    Posts:
    254
    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?
     
  2. MSplitz-PsychoK

    MSplitz-PsychoK

    Joined:
    May 16, 2015
    Posts:
    1,278
    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!
     
  3. William_Lee_Sims

    William_Lee_Sims

    Joined:
    Oct 11, 2014
    Posts:
    40
    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.
     
    casimps1 likes this.
  4. casimps1

    casimps1

    Joined:
    Jul 28, 2012
    Posts:
    254
    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.