[NEW UPDATE!] Fingers - Touch Gestures - #1 in Quality, Support and Features : Dozens of Gestures✓

Greetings! This thread is for the asset “Fingers - Touch Gestures for Unity”.

Download Fingers From the Unity Asset Store

Fingers is your one stop choice for all gesture handling in Unity (and other C# platforms as Fingers has no Unity specific code). Fingers has been tested and runs great on MAC, Windows, iOS and Android. Full C# source code and shader code is provided!

With Fingers, you get all the common touch gestures you are used to built in. This includes: tap, double tap, long tap, pan, rotate, scale and swipe gestures. In addition, creating your own custom gestures is simple and easy.

I’ve recently began adding on-screen controls. Right now a joystick and dpad are included with more controls planned for the future.

Adding gestures in the inspector has never been easier. Simply add from the component menu and configure your gesture. Set the callback to your script and you are done!

Pan/rotate/scale and drag and drop is simple. Built in scripts for these scenarios, with demo scenes are provided.

I’ve also added image recognition gestures. With a few minutes of tweaking, you can recognize shapes like circles, lightning bolts, check marks and the letter X.

Previewing gestures in the player is easy, even without a touch screen. Just use the shift and control key plus mouse wheel to simulate pinch and rotate gestures, along with each button to simulate a different finger.

Fingers has a similar architecture to UIGestureRecognizer from iOS, but is built using all C# code and will easily run on any platform that has a mouse or touch screen.

Gestures are restricted to most UI elements by default, but this is easily configured if you want the gestures to pass through additional UI elements. This asset works great with the default Unity UI and Event System.

Gestures can be executed simultaneously or exclusively (the default). In addition, gestures can require other gestures to fail (such as a tap requiring a double tap to fail).

Fingers requires knowledge of C# and Unity scripting to integrate, but the number of lines of code to get up and running should be minimal. A demo scene and script is provided to show you how the gestures work.

Fingers uses inches by default to measure distances for certain thresholds, but this can be changed via properties on the gestures.

When using Fingers with Unity Remote, you may want to temporarily disable mouse handling via script property.

Please see the included Readme.txt file and demo script for a more in-depth guide.

This code works great even outside of Unity. For example, I am using this code for a Xamarin Android drawing app (You Doodle) instead of the native Android gestures! Fingers gestures framework does not contain any Unity specific code so the framework will run great anywhere C# is supported. If you want this in Xamarin, you just have to write the adapter to send touch events.

I’ve included my Xamarin Android touch adapter code in the Readme.txt file at the bottom.

Download Fingers From the Unity Asset Store

seems the link isn’t correct jjxtra

Looks like a special character got in there when I copied and pasted the URL. Thanks for the heads up.

1 Like

Hi, I have some questions about Fingers: I need use two fingers to move an object on Y axis (to simulate up and down movement) and one finger to move on X and Z axis, is that possible?

Should be. You could use a pan gesture for this with maximum allowed touches of 2. Can these two gestures execute simultaneously?

Hi! I have an issue with this pack… I put a custom gesture on the scene… a “D” letter. After that I put in the script: if “D” is recognized to jump to another scene…if I write a “D” on the screen is working… the scene change to what I want to. after that when I come back to the D recognizing scene, the script isn’t work anymore. Nothing happening when I write a gesture, not even tty again … Any ideea how to fix this ? Thanks

When you change scenes, gestures are cleared. I think there is a bool property you can set on the FingersScript to keep the gestures even when changing scenes.

Hi jjxtra, I solved the problem by adding the reset code before the command:

Image.texture = t;
lastImage = imageGesture.Image.Clone();

if (imageGesture.MatchedGestureImage == null)
{
MatchLabel.text = “PLEASE TRY AGAIN”;
}
else
{
//MatchLabel.text = "GOOD, YOU DREW : " + recognizableImages[imageGesture.MatchedGestureImage] ;
imageGesture.Reset();
ResetLines();
UpdateImage();
Application.LoadLevel(“Pachet_gri_content”);

}

Thank you. Now it works awesome!

Glad it’s working! Send a link to your game when it’s ready to test!

In your demo you had UI elements labeled “Touches Pass Through…” and “I Eat Touches”. What determines the passthrough and the consumption of the touches? How does it react when you have one finger on and one finger off of the “I Eat Touches”? Thanks!

The I eat touches button will not allow the touch to pass through to gestures. So that finger would have to release and start somewhere else to be part of a gesture. The script has several ways to determine which Ui elements block touches and which allow them to be part of gestures. All of this is demonstrated in a demo scene.

Great! Thanks for the reply. I was concerned that you were relying on the default behavior of Unity touches (which is a bit questionable).

just wondering what sort of latency you are seeing with your library? Mainly interested in tap, long tap and double tap. I understand it would depend on phone model and OS but do you have any figures?

I want to report a bug in the DemoScene: when i rotate the object using two fingers it works as expected, but when i remove just one finger and put it again, i expect detect that i could resize the objet again, but it doesnt work.
Here is a video, showing the bug.

2936385–217197–fingerBug.mp4.zip (2.49 MB)

Latency for tap and double tap is configurable. You specify the amount of time that must pass before the double tap fails.

This is currently by design. The gesture ends when you release the one finger. In order to start again, it needs two new fingers.

I updated the project and with that I was able to solve the problem, besides I put it in Start:

void Start()
{
TreatMousePointerAsFinger=false;
SimulateMouseWithTouches=true;
}

With that the problem has been solved, more thanks!

1 Like

Hi Jeff.

I noticed in your youtube clip you successfully drawn an X. I was wondering how you achieved it. When I release (in the demo scene) after drawing the first line, the image is a recognised before I can complete add the second stroke.

Thanks kindly.

You can use DemoSceneImage or raise MaximumPathCount to 2 on the image gesture.

Wow. Fast response. Much obliged.

1 Like