TouchScript — multi-touch library for Unity [RELEASED]

Please post all your questions on the official board:
Loading...! Questions posted here probably will not be answered!

Before posting questions or bug reports please make sure that:

  • Read documentation at the Wiki,

  • Browsed through examples bundled with the library,

  • Looked at tutorials.

If you think there must definitely be a bug please post it at Github.

Thank you.

TouchScript. Multitouch library for Unity.

TouchScript is much more than a handful of routines to receive touch events from different sources. Inspired by iOS, TouchScript makes handling complex gesture interactions on large touch surfaces much easier. Unity and Flash implementations are developed to work together in Scaleform environment.

TouchScript is a multitouch framework for Unity. It was developed by Valentin Simonov (me) at Interactive Lab to:

  • Provide a reliable way to code multitouch interfaces on various devices.
  • Unify different input methods.
  • Handle complex interactions between gestures.
  • Take into account differences between a large touch surface and an iPad.

Official site: http://interactivelab.github.com/TouchScript/
Github repository: GitHub - InteractiveLab/TouchScript

Features

  • Easy and intuitive API.
  • Works on PC (Windows 7 and Windows 8), Mac, iOS, Android and Windows RT.
  • Doesn’t require Unity Pro.
  • Supported input sources: TUIO, mouse, mobile (iOS, Android, WinRT) and native Windows touch.
  • Groups touch points into clusters on big touch surfaces.
  • Manages simultaneous gesture recognition within scene hierarchy (inspired by iOS).
  • Comes with many commonly used gestures. Easy to write custom ones.
  • Easy to test multitouch gestures without actual multitouch device using built-in second touch simulator (activated with Alt+click), TUIOPad on iOs or TUIODroid on Android.
  • It’s free and open-source. Licensed under MIT license.
  • And more…

All our (Interactive Lab) multitouch projects were done using TouchScript. You have probably seen these ones from Unity videos site or at Unite’12 keynote.

https://vimeo.com/50593577

https://vimeo.com/33590185

2 Likes

WOW FREE?! AND OPEN SOURCE?!! INCREDIBLE !!!
Looks like Input.Touches/Easy Touch/FingerGesture just got some serious competition!
Thanks so much for sharing!

They are oriented on mobile devices, TouchScript was made for large touch surfaces.
It’s not optimized (yet) for iOS and Android. I hope someone will get to it eventually since the infrastructure is ready.

Thanks, this is a great idea!

I am pretty sure that unity3d community will do a good job with oyur project! :slight_smile:

Thanks a lot for this!

I can confirm that as with the earlier version, the Windows 7 touch works with Windows 8 too :slight_smile:

(I tested with an Acer T232HL windows 8 multitouch monitor)

Hey Guys,

I’m having a tough time finding documentation or examples on how to use multiple gestures together in Unity

I’d like to use the PanGesture to allow camera rotation. I accomplish this by placing a plane as a child of the camera and tracking finger movement by attaching a PanGesture to the plane. However, any TapGestures placed on elements in the scene are blocked by the plane in front of the camera. How would you recommend approaching this with your library?

Thanks!
Ryan

One way would be to use FullscreenBackgroundTarget which does just what you said. Attach it to your camera.
I don’t remember when I used it the last time but it should work. The difference between FullscreenBackgroundTarget and your approach is that FullscreenBackgroundTarget places a BoxCollider at the far clipping plane of a camera. So if an object is further away you can’t see it anyway.

I’m having some issues getting this to work with Windows 8 and using a Dell S2340T multitouch monitor. The monitor appears to support native Windows Touch (Windows recognizes pinch zoom, I can see up to 10 blobs on the screen, etc. etc.), but when I build and run the project, it only captures a single point. Is there something I’m missing from the examples?

Do you use Win7TouchInput and not MouseInput?

Ouch! TouchScrip requires Unity Pro. Why in the world would a ouch input framework require System.Net.Sockets ?

I get the following warning when I try to build the Everything Combined Example project.

Error building Player: SystemException: System.Net.Sockets are supported only on Unity iOS Pro. Referenced from assembly ‘OSCsharp’.

Main touch input in multitouch world is still TUIO which is a network protocol.
That’s why it needs System.Net.Sockets.

You can fork the repository and remove TUIOInput and all references to TUIO from the project.

Seems like that would adversely affect it.

Yes, but the main reason it to be opensource is that I got time only for functionality I need and bug fixes.
If you need some additional functionality you can always implement it yourself.

Yeah. I can see that and it is good for others with more time than both of us. The reason for me to consider such a tool is precisely because I don’t have the time or don’t want the bother of implementing it myself. But it does look like a very good tool.

I cannot believe I missed that! Thank so much, works like a charm!

So far this framework is proving to be great! Question - is it possible to use this framework to rotate an object with a single touch? We’d like to rotate a 3D object around it’s center point on a single touch - ideally it would be coupled with the built-in Scale gesture (which works great as-is).

Sure, you’ll need to write a custom gesture, add it and Scale Gesture to your object and add one of them to WIll Recognize With array of the other one.
You can check out how Pan Gesture is made and use it to make a custom gesture which uses cluster’s center not to move ano object but to rotate based on distance traveled or angle between camera normal and ray from cluster’s center.

I tested it on windows 7 with multitouch monitor, but only one touch working. No response of multitouch. Can you tell me what i am doing wrong here?

Are you using MouseInput or Win7TouchInput?