Coder Social home page Coder Social logo

touchscript's Introduction

TouchScript — multi-touch library for Unity

When working on a project for mobile devices or PCs with touch input you will soon require basic gestures like tap, pan, pinch and zoom — they are not hard to implement manually using Unity API or using a package from Asset Store. The hard part is to make these gestures work together, e.g. to have a button with a tap gesture placed on a zoomable window. This is where you will need TouchScript — it makes handling complex gesture interactions on any touch surface an effortless job.

Why TouchScript?

  • TouchScript abstracts touch and gesture logic from input methods and platforms. Your touch-related code will be the same everywhere.
  • TouchScript supports many touch input methods starting from smartphones to giant touch surfaces: mouse, Windows 7/8 touch, mobile (iOS, Android, Windows Store/Windows Phone), TUIO.
  • TouchScript includes common gesture implementations: press, release, tap, long press, flick, pinch/scale/rotate.
  • TouchScript allows you to write your own gestures and custom pointer input logic.
  • TouchScript manages gestures in transform hierarchy and makes sure that the most relevant gesture will receive touch input.
  • TouchScript comes with many examples and is extensively documented.
  • TouchScript makes it easy to test multi-touch gestures without an actual multi-touch device using built-in second touch simulator (activated with Alt + click), TUIOPad on iOS or TUIODroid on Android. Read more.
  • It's free and open-source. Licensed under MIT license.

Developed by Valentin Simonov.

Getting started

Downloading the package

To use TouchScript in your project you either need to

Your first TouchScript project

To test how TouchScript works, create an empty scene and drag two prefabs from TouchScript/Prefabs folder to the scene: TouchManager and 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.

You can make any GameObject react to touch input — just attach one of the scripts called Gestures to it. TouchScript ships with a few built-in Gestures which you can find in Component/TouchScript/Gestures menu. It is also possible to write your own gestures.

To test how built-in Gestures work, create an empty cube in the scene and attach a 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.

Press Play. Note how you can drag the object with one touch and scale or rotate it with two touches. Don't forget that you can use Alt + click to simulate a second pointer (read more more about testing multi-touch gestures).

Examples

TouchScript comes with many examples in TouchScript/Examples folder. Open Examples.unity scene and read description for every example to find out what it is about.

All examples are explaned here.

What to read next

Need help?

If you have a problem using TouchScript or running examples please check the FAQ before submitting issues.

  • FAQ
    Some of the questions have been already asked multiple times. Check if yours is in the list.
  • Documentation
    Complete up-to-date generated docs with all public API annotated.
  • Official Forum
    Want to ask a question about TouchScript? Use the official Forum.
  • Issues
    Found a bug? Got a feature request? Feel free to post it in Issues.

touchscript's People

Contributors

benoitjadinon avatar bering avatar capnslipp avatar darkon76 avatar deadninja avatar denizpiri avatar gregharding avatar manefunction avatar mholub avatar o1o1o1o1o2 avatar paynechu avatar pharaohmaster avatar shreks7 avatar tachylatus avatar valyard avatar yerek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

touchscript's Issues

I got an exception when I use MetaGesture and run in iOS device

ExecutionEngineException: Attempting to JIT compile method '(wrapper managed-to-native)       System.Threading.Interlocked:CompareExchange    (System.EventHandler`1<TouchScript.Gestures.MetaGestureEventArgs>&,System.EventHandler`1<TouchScript.Gestu    res.MetaGestureEventArgs>,System.EventHandler`1<TouchScript.Gestures.MetaGestureEventArgs>)' while running     with --aot-only.

at TouchScript.Gestures.MetaGesture.add_TouchPointAdded (System.EventHandler`1 value) [0x00000] in <filename unknown>:0 
at TestTouch.Start () [0x00000] in <filename unknown>:0 

using UnityEngine;
using System.Collections;
using TouchScript.Gestures;

public class TestTouch : MonoBehaviour {

// Use this for initialization
void Start () {
    GetComponent<MetaGesture>().TouchPointAdded += HandleTouchPointAdded;
}

void HandleTouchPointAdded (object sender, MetaGestureEventArgs e)
{
    Debug.Log("d");
}
}

`

can TouchPoint's Hit and Target setter be public ?

same as title.
Because I want to create my own CameraLayer need to assign the touch.Hit and touch.Target in my own assembly file. since you set the setter is internal. I have no way to do that except change the TouchScript's code and compile myself.

Unity 4.3 2D Support

Hi,

Are there plans to integrate this with Unity's new 2D functionality? The Gestures do not currently work with the Physics 2D colliders.

Adam

Modifying the Basic Scene from Unity

I am modifying the basic example scene that comes with the Unity example.Single touch is working perfect but Multitouch is not working for me i have added balls with Cube but i am unable to break the balls and Cubes at one go with say two finger touch simultaneously.Can you provide me some insights what modifications need to be done.I am developing for Ultrabook with ten finger input touch.I have removed the mouse input only using the TUIO Input for touch.

ScaleGesture.LocalDeltaScale limitation

Hello.

Using TuioPad as input, i get maximum values from 0.8 to 1.1 for ScaleGesture.LocalDeltaScale (tested with all projection types). Also the curve from 1 to 1.01 is not linear (the middle value is 1.1)
So it's not really useable, of course.

Any clue ?

Regards,
Alain

missing source files

I downloaded your latest zip file, and it seems that we're missing the entire ru.valyard folder. Any thoughts on this?
ru\interactivelab\touchscript\inputSources\TuioInput.as(27): col: 56 Error: Interface ITUIOCursorListener was not found.

WACK - Windows Metro App Cert.

Hey,

I am trying to pass WACK with the TouchScript library. Unfortunately there are some features that prevent to use the package with the upcoming Win8 Plugin.

I thought I let you know, where the Issues are:
Firstly, I had to cut out the Win7 and Remote Features to be able to deference the TUIOSharp and OSCSharp libraries. Both seem to be more than incompatible to pass WACK because they use function calls outside of .NET for Windows Store apps and closer to system specific functions like WindowHandling.

    API System.Timers.Timer in SYSTEM, PUBLICKEYTOKEN=B77A5C561934E089 is not supported for this application type. TouchScript.dll calls this API.
    API System.Timers.ElapsedEventHandler in SYSTEM, PUBLICKEYTOKEN=B77A5C561934E089 is not supported for this application type. TouchScript.dll calls this API.
    API System.Timers.ElapsedEventArgs in SYSTEM, PUBLICKEYTOKEN=B77A5C561934E089 is not supported for this application type. TouchScript.dll calls this API.
    API System.String.Format(System.String,System.Object) in MSCORLIB, PUBLICKEYTOKEN=B77A5C561934E089 is not supported for this application type. TouchScript.dll calls this API.
    API System.EventArgs.#ctor(System.UIntPtr) in MSCORLIB, PUBLICKEYTOKEN=B77A5C561934E089 is not supported for this application type. TouchScript.dll calls this API.
    API System.Timers.ElapsedEventHandler.#ctor(System.Object,System.IntPtr) in SYSTEM, PUBLICKEYTOKEN=B77A5C561934E089 is not supported for this application type. TouchScript.dll calls this API.
    API System.Timers.Timer.add_Elapsed(System.Timers.ElapsedEventHandler) in SYSTEM, PUBLICKEYTOKEN=B77A5C561934E089 is not supported for this application type. TouchScript.dll calls this API.
    API System.Timers.Timer.set_AutoReset(System.Boolean) in SYSTEM, PUBLICKEYTOKEN=B77A5C561934E089 is not supported for this application type. TouchScript.dll calls this API.
    API System.Timers.Timer.set_Interval(System.Double) in SYSTEM, PUBLICKEYTOKEN=B77A5C561934E089 is not supported for this application type. TouchScript.dll calls this API.
    API System.Timers.Timer.Start in SYSTEM, PUBLICKEYTOKEN=B77A5C561934E089 is not supported for this application type. TouchScript.dll calls this API.
    API System.Timers.Timer.Stop in SYSTEM, PUBLICKEYTOKEN=B77A5C561934E089 is not supported for this application type. TouchScript.dll calls this API.
    API System.Timers.Timer.#ctor in SYSTEM, PUBLICKEYTOKEN=B77A5C561934E089 is not supported for this application type. TouchScript.dll calls this API.
    API System.String.Format(System.String,System.Object,System.Object,System.Object) in MSCORLIB, PUBLICKEYTOKEN=B77A5C561934E089 is not supported for this application type. TouchScript.dll calls this API.

I would be interested, if you plan on supporting Win8 Metro Apps and if you see a work around or solution for passing WACK?

Application crashes on exit when using WMTouch Input

First of all, thank you for this great Unity library! It's a breeze to work with and well thought-out.

We noticed that the application always crashes on exit (Alt+F4 or closing the window) when using the WMTouch Input script. This is a big problem for us, because we want to run the application unattended. Could you please look into this?

Platform: Windows 7 Ultimate
Unity: version 4.0.1f2

Kind regards.

Error on TouchScript package import unity 4.1.3 (mac os 10.8.3)

Hi I'm getting the following error on importing the package.

Assets/TouchScript/Examples/Basic/Scripts/Breaker.cs(22,9): error CS0309: The type TapGesture' must be convertible toUnityEngine.Component' in order to use it as parameter T' in the generic type or methodUnityEngine.Component.GetComponent()'

I've tried from the asset store, github and the direct download.

Is there a basic step I'm missing - copying the dll's for example?
Thanks, Kind regards, Ian

Gameobject error

When i try to rotate an object which has rotate gesture, simple pan gesture and transformer2D, i get this error UnityEngine.Transform.InverseTransformDirection (Vector3 direction) (at C:/BuildAgent/work/cac08d8a5e25d4cb/Runtime/ExportGenerated/Editor/UnityEngineTransform.cs:275)

Ii would be great if you can help me

Tutorial Problem

Hi, I'm following your tutorial at page http://interactivelab.github.com/TouchScript/

However at the part GetComponent().StateChanged += HandleStateChanged; I get a NullReferenceException: Object reference not set to an instance of an object??

I'm using unity 4 with the TouchScript.unitypackage and everything in the tutorial has worked perfectly for me up till that point. I hope it's not me doing something dumb but any help would be much appreciated!

Thanks

An element with the same key error

Hellow, i have a problem with my project, When i use the touch it gives me this error.
ArgumentException: An element with the same key already exists in the dictionary.
System.Collections.Generic.Dictionary`2[System.Int32,TouchScript.TouchPoint].Add (Int32 key, TouchScript.TouchPoint value) (at /Applications/buildAgent/work/c514da0c8183631c/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:404)
TouchScript.TouchManager.updateBegan ()
TouchScript.TouchManager.updateTouches ()
TouchScript.TouchManager.Update ()
It would be great if you can help.
Thank you in advance.
Goodbye

Error trying to add Touch Manager

I was getting an error trying to add TouchManager (code, not dll) to a GameObject: "The class defined in script file TouchManager does not match the filename"...

That was common in Unity 3 when trying to use namespaces with MonoBehaviours, but I'm using Unity 4.1.3! So I found out that it breaks if you use namespaces + MonoBehaviour + default parameters.

I removed the 'true' from 'bool includeSelf' in line 877 and it worked.
I wonder why you are not getting this error. Maybe they fixed it in Unity 4.1.5...

Touchscript on GuiTexture

Hi,

I'm trying to recognize a tabgesture on a guitexture but it seems this doesn't work the same way as it was shown in the basic tutorial for 3d elements. Does anyone know how to recognize touches on GuiTextures?

Thanks for the help :)
Jenny

How to get gestures in multiple objects?

Question:
I have different Game Objects with Gestures - hence multiple Box Colliders - in my scene and sometimes I end up with a pan gesture, for example, being ignored because there is another object in front of it with a scale gesture receiving the hits. Is there a way to make the raycast hit multiple objects? This is not an Unity question, I mean, am I missing something in your API that enables multiple objects to be manipulated by one single gesture?


My use case: I have a camera that zooms in/out using the ScaleGesture, and its collider is in front of it; further there are objects that use PanGesture to be moved. I'm missing the pan gestures when the camera collider is active.

Right Mouse Button Hack

Hey,

I wrote a little Hack for supporting the right mouse button ingame, maybe someone is interested in this feature, or you may plan to integrate it further.

...
    public class MouseInput : InputSource
    {
        #region Private variables

        private bool lockLeft = false;
...
        protected override void Update()
        {
            base.Update();

            var upHandled = false;
            if ((Input.GetMouseButtonUp(0) && lockLeft) || (Input.GetMouseButtonUp(1) && !lockLeft))
...

            if ((Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1)) && mousePointId == -1)
            {
                lockLeft = Input.GetMouseButtonDown(0);
                var pos = Input.mousePosition;

                if ((Input.GetKey(KeyCode.LeftAlt) || Input.GetKey(KeyCode.RightAlt)) && fakeMousePointId == -1)
                {
...
                }
            }
            else if (((Input.GetMouseButton(0) && lockLeft) || (Input.GetMouseButton(1) && !lockLeft)))
            {
...
            }

            if (((Input.GetMouseButtonUp(0) && lockLeft) || (Input.GetMouseButtonUp(1) && !lockLeft)) && !upHandled)
            {
...
            }
        }

...

In order to differentiate in Unity I use the standard API Input functions:

bool leftButton = Input.GetMouseButton(0);
bool rightButton = Input.GetMouseButton(1);
bool noMouse = !Input.GetMouseButton(0) && !Input.GetMouseButton(1);

Windows 7 Touch Pan / Orbit Camera

Hello,

I am trying to get TouchScript to work with pan and an orbiting camera. So far I have managed to get the flick gesture to work with the orbiting camera (Using KGFOrbitCam) but no the pan gesture.

Here is the code

using TouchScript.Events;
using TouchScript.Gestures;
using UnityEngine;
using System.Collections;

public class cameraControl : MonoBehaviour {
    public KGFOrbitCam itsOrbiter;
    private Vector3 speed;

    void Start () {
        GetComponent<FlickGesture>().StateChanged += flickHandler;
        GetComponent<TapGesture>().StateChanged += tapHandler;
    }

    private void flickHandler(object sender, GestureStateChangeEventArgs e){
        if(e.State == Gesture.GestureState.Recognized){
            var spd = ((sender as FlickGesture).ScreenFlickVector/(sender as FlickGesture).ScreenFlickTime);
            speed = new Vector3(spd.y, -spd.x, 0);
            float aCurrentCameraRotationLeftRight = itsOrbiter.GetTargetRotationLeftRight();
            float aCurrentCameraRotationUpDown = itsOrbiter.GetTargetRotationUpDown();
            itsOrbiter.SetTargetRotationLeftRight(aCurrentCameraRotationLeftRight+(spd.x)*Time.deltaTime);
            itsOrbiter.SetTargetRotationUpDown(aCurrentCameraRotationUpDown+(-spd.y)*Time.deltaTime);
        }
    }

    private void panHandler(object sender, GestureStateChangeEventArgs e){
        if(e.State == Gesture.GestureState.Recognized){
            var pos = (sender as PanGesture).ScreenPosition;
            Debug.Log(pos.y);
        }
    }

    private void tapHandler(object sender, TouchScript.Events.GestureStateChangeEventArgs e){
        if(e.State == Gesture.GestureState.Recognized){

        }
    }
}

I appreciate any help you can give!

Jose

[Question] Detect touch position

Hi!

First of all, wonderfull work guy. I have to questions.
I want to know how can i reference the touch coordinates in my screen, just like i do it with "Mouse X" and "Mouse Y" for the mouse input.
Second, if i want to do a script using Touchscript feautres, i can only do it in C# or i can use Javascript as well?

Thanks.

scene to scene error

hello~

i just test go to another scenes as attached pic.

but i got error

plz let me know how can i solve it out

thanks

scenetoscene

Fail but Possible ?

Hi.

With Unity, i'm trying to control an orbital 3D camera from gesture.
I've added an invisible fullscreen object (with collider) parented to the camera, so it catch the whole screen, and added all gesture component (pan,rotate..) and finaly a script that receive all events and dispatch them to my camera.
(I use a different collision layer to be able to pick in the scene)

1/ i can't find any description of the gestures ? two finger, tree finger, what move is expected etc.. from a user point of view.
2/ for all events, i receive "Failed" and "Possible" on the first frame with two or more fingers, then nothing else.. whatever i try to produce (see point 1)

Any tips ?

Meanwhile i'll directly work with TouchManager.Touches, and it's allready a great help !
Debug Camera prooved me low level is working nicely, so thanks for this nice lib anyway.

And keep up you'r inspiring projects.

Regards,
Alain.

ps : dunno how to set this message as a "comment" and not an issue... sorry with that.

[Q] Swiping over multiple dynamically created objects

First off: Great project!

I am having problems to grasp the concepts behind it, allthough the documentation was helpful. What I am trying to do is, have to have multiple objects react to being pressed when swiping over them. I Would appreciate it, if someone could point me in the right direction.

Thanks.

RotateGesture local projection + Orthographic camera

RotateGesture allows to rotate object only in one direction when using Local or Global projection type for this gesture together with Orthographic projection in camera - is this a bug? ( Unity 4.3.1.f1 free, TouchScript 3.1)

Building a 2-finger pan gesture for 23" touch screen

Hello,
I am adapting an existing 3d unity program for use with a 23" touch screen which can recognize two fingers. For this I use the following gestures:

  • pan for drag&drop of special objects (target is an draggable object)
  • also pan for rotation in scene (background target)
  • ScaleGesture for zoom
  • no gesture for panning in scene yet
    I want to implement a pan gesture which starts if two fingers in an near area touch the screen and which updates if the two fingers are moving over screen together. How could I do this best? I tried to work with a PanGesture, which only starts panning of the camera if panGesture.ActiveTouches.Counts > 1, but this only works with emulator, not with the touch screen. I tried the same thing with meta gesture, but it also didn't work.
    Any ideas?

Regards,
Benjamin Schäfer

Fix obsolete warnings in Unity4

Assets/TouchScript/Examples/Everything Combined/Scripts/BackgroundCube.cs(25,27): warning CS0618: UnityEngine.Transform.RotateAroundLocal(UnityEngine.Vector3, float)' is obsolete:use Transform.Rotate instead.'

Assets/TouchScript/Examples/Everything Combined/Scripts/BackgroundSpawner.cs(44,126): warning CS0618: UnityEngine.Camera.far' is obsolete:use Camera.farClipPlane instead.'

Assets/TouchScript/Examples/Simple Gestures/Scripts/FullscreenZoom.cs(15,75): warning CS0618: UnityEngine.Transform.RotateAroundLocal(UnityEngine.Vector3, float)' is obsolete:use Transform.Rotate instead.'

running on ios

i've been trying to get touchscript running on my ipad, however i dont receive any touch inputs (i've just figured out that it's probably a error in my script).

also if i have win7touchinput added it crashes with the following error:
"Unable to resolve pinvoke method 'TouchScript.InputSources.Win7TouchInput:GetForegroundWindow ()' Re-run with MONO_LOG_LEVEL=debug for more information."
this error can be prevented by adding Win7TouchInput.cs at line 84:

after

if (Application.isEditor) return;

add

if (Application.platform != RuntimePlatform.WindowsPlayer)
return;

Multiple tap/touches support

It would be great to have double-tap, two-finger-tap, etc support in TapGesture (and in PanGesture/etc, but one thing at a time perhaps).

Apple's UITapGestureRecognizer has, as an API example:

numberOfTapsRequired
The number of taps for the gesture to be recognized.

numberOfTouchesRequired
The number of fingers required to tap for the gesture to be recognized.

Support for Windows Phone

Cannot Build to Windows Phone. Error is:

Error building Player: Exception: Error: type System.Net.Dns doesn't exist in target framework. It is referenced from OSCsharp.dll at System.Net.IPAddress[] OSCsharp.Net.IPServer::GetLocalIPAddress()

Mac OS X Touch screen support

Hi,

This is not an Issue. I just wanted to ask a question, but couldn't find anywhere else to contact. So I'm posting the question here.
I need to create a Mac app which shows 3D models and those should support the multi touch support. This will be run in a Mac computer and the touch screen will be a Mac OS X touch screen. I'm planning to use Unity web player. I need to know whether I can use the TouchScripts library for that. Does it work in Mac touch screen.(at the moment I don't have a Mac touch screen to test. But that's the client requirement).

Under Works on part it says Mac
But under Supported input sources: it doesn't mention anything about Mac touch screens.
So I'm not sure whether it'll work or not.

Thanks.

Сompatibility NGUI 3.0.6 (Panels will now add rigidbodies)

TouchScript.Layers.CameraLayer.beginTouch use raycastHit.rigidbody, but Gesture component added on raycastHit.collider

@@ -116,7 +116,8 @@ namespace TouchScript.Layers
             if (result == LayerHitResult.Hit)
             {
                 touch.Hit = hit;
-                touch.Target = hit.transform;
+                // nGUI use rigidbody, but need collider    
+                touch.Target = hit.collider == hit.rigidbody ? hit.transform : hit.collider.transform;
             }
             return result;
         }

How to use TouchScript with NGUI (was: metagesture bug)

in TouchScript/Gestures/MetaGesture.cs

the states are changed after the event is sent, this way it's impossible to detect a ended or cancelled event.

--- from line 71, should be ---

    protected override void touchesEnded(IList<TouchPoint> touches)
    {
        if (State == GestureState.Began || State == GestureState.Changed)
        {
            if (activeTouches.Count == 0)
            {
                setState(GestureState.Ended);
            }
        }
        if (TouchPointRemoved != null)
        {
            foreach (var touchPoint in touches)
            {
                TouchPointRemoved(this, new MetaGestureEventArgs(touchPoint));
            }
        }
    }

    protected override void touchesCancelled(IList<TouchPoint> touches)
    {
        if (State == GestureState.Began || State == GestureState.Changed)
        {
            if (activeTouches.Count == 0)
            {
                setState(GestureState.Ended);
            }
        }
        if (TouchPointCancelled != null)
        {
            foreach (var touchPoint in touches)
            {
                TouchPointCancelled(this, new MetaGestureEventArgs(touchPoint));
            }
        }

    }

--- end ---

running on ios

i've been trying to get touchscript running on my ipad, however i dont receive any touch inputs. is there any special case getting touch informations in combination with the MetaGesture?

also if i have win7touchinput added it crashes with the following error:
"Unable to resolve pinvoke method 'TouchScript.InputSources.Win7TouchInput:GetForegroundWindow ()' Re-run with MONO_LOG_LEVEL=debug for more information."
this error can be prevented by adding Win7TouchInput.cs at line 84:

after

if (Application.isEditor) return;

add

if (Application.platform != RuntimePlatform.WindowsPlayer)
return;

How to end gesture when not touching object?

What is the best way to end a gesture when the touch is no longer hitting the object?
For example, I have a plane where I'm using PanGesture to draw on it, but it's not supposed to draw outside the plane, so the gesture should be disabled when hitting the border.

Additionally, it should reenable the gesture (or create another gesture) if the fingers reenter the plane (in the same movement).

TouchScript does not work the second time I load the scene

I have a scene in my unity project where I use TouchScript. It works just perfect. But - if I switch to another scene and later load again the scene containing TouchScript - it does not work anymore. What am I doing wrong? I included all the necessary components into that scene - it seems to me that something in the script does not work anymore if it is called a second time...

Flick Gesture Issue with Rigidbody on parent's gameobject (Unity).

Hello,

First of all, I have to thank you for sharing that amazing script. I was looking for gestures I could use with my Ipad. And I finally found yours.

I have stumbled onto an issue and I wanted to ask you how to resolve it.
I don't know if this is the right place to ask ... so please escuse me in advance if not.

I have added your flick gesture to be able to move my character by using a finger (move left, right, up, down, etc.). It works in the demo scene you provide.

Here is my setup:
Player (prefab parent)
---- Cube's Player (my 1st person character + script + RigidBody, parented to the Player's Transform)
-------- Camera (parented to the 1st person character Transform).

When I add all your scripts necessary for the flick gesture, I need to remove the RigidBody on the Cube's Player in order to detect the gesture. If I keep the RigidBody, it won't work.

Is there a way to make it work without removing the rigidbody ? I use a lot of script to detect my player using that rigidbody ...

Thanks,
Laurel.

MouseInputSource and WinTouch7Source Conflict

Hello,

We have conflict when we have both MouseInputSourceSurce and Win7TouchInputSource activated simultaneously with touch screen.
I think there are two touch returned simultaneously when we use a win7 touch screen (first via mouse input and second via the Touch interface).
Do you know a simple way to avoid this ?
Thanks
Jérôme

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.