TouchScript — multi-touch library for Unity
- TouchScript allows you to write your own gestures and custom pointer input logic.
- TouchScript comes with many examples and is extensively documented.
- It's free and open-source. Licensed under MIT license.
Developed by Valentin Simonov.
Downloading the package
To use TouchScript in your project you either need to
- download the latest release from Github,
- or get it from Asset Store,
- or clone the repository and use the source (more info on how to do it).
Your first TouchScript project
TouchScript/Prefabs folder to the scene:
Cursors. Press Play and click or touch (if your PC supports touch input) the Game View — you will see colored circles, pointer cursors.
Note: to simulate a second pointer you can hold Alt and click anywhere within the Game View.
Component/TouchScript/Gestures menu. It is also possible to write your own gestures.
TransformGesture to it either from
Component menu or
Add Component button. Make the cube large enough to be able to touch it with two fingers. Attach another component called
Transformer to the cube — this component listens to events from
TransformGesture and applies translation, rotation and scaling to the GameObject.
TouchScript/Examples folder. Open
Examples.unity scene and read description for every example to find out what it is about.
What to read next
- How to receive a pointer.
- What is a Gesture and how to work with it.
- What is an Input Source and why it is needed.
- What is a Layer and why it is needed.
- Some info on how TouchScript works internally.
- How to affect which objects can be touched.
- How to change touch coordinates from an input device.
- How to write a custom Gesture.
- How you can help.
Some of the questions have been already asked multiple times. Check if yours is in the list.
Complete up-to-date generated docs with all public API annotated.
- Official Forum
Want to ask a question about TouchScript? Use the official Forum.
Found a bug? Got a feature request? Feel free to post it in Issues.