Search Unity

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

Discussion in 'Assets and Asset Store' started by jjxtra, Apr 25, 2016.

  1. Solid_Metal

    Solid_Metal

    Joined:
    Mar 25, 2015
    Posts:
    45
    yes, i'm using joystick prefab provided in your asset
     
  2. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,464
    Ok I don't quite understand what you are asking, let's take this to email : support@digitalruby.com, try and give me more details there, maybe a screenshot or two.
     
  3. zukinet

    zukinet

    Joined:
    Oct 30, 2016
    Posts:
    51
    Hi,

    i try to make left-right swipe to move my camera.

    However, sometimes my tap/swipe doesn't not work (nothing happen), sometimes work. I would like to know. Are this problem related to Performance ? or i miss something in this library.

    Below are my code ( i also use dotTween for move transition) :

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using DigitalRubyShared;
    5. using DG.Tweening;
    6.  
    7. public class CameraController : MonoBehaviour {
    8.  
    9.     private Vector3 offset;
    10.     private string direction;
    11.     private float default_camera_x = 12;
    12.     private float default_camera_y = 6;
    13.  
    14.     public GameObject cameraMover;
    15.  
    16.     // Use this for initialization
    17.     void Start () {
    18.  
    19.         SwipeGestureRecognizer swipe = new SwipeGestureRecognizer ();
    20.         swipe.Updated += Swipe_Updated;
    21.         swipe.DirectionThreshold = 0;
    22.         FingersScript.Instance.AddGesture(swipe);
    23.         TapGestureRecognizer tap = new TapGestureRecognizer();
    24.         tap.Updated += Tap_Updated;
    25.         FingersScript.Instance.AddGesture(tap);    
    26.  
    27.         offset = transform.position;
    28.  
    29.     }
    30.  
    31.     // Update is called once per frame
    32.     void Update () {
    33.  
    34.     }
    35.  
    36.     //en::callback event for Swipe Detection
    37.     private void Swipe_Updated(GestureRecognizer gesture, ICollection<GestureTouch> touches)
    38.     {
    39.         SwipeGestureRecognizer swipe = gesture as SwipeGestureRecognizer;
    40.         if (swipe.State == GestureRecognizerState.Began)
    41.         {
    42.             float angle = Mathf.Atan2(-swipe.DistanceY, swipe.DistanceX) * Mathf.Rad2Deg;
    43.             direction = swipe.EndDirection.ToString();
    44.  
    45.             switch (direction)
    46.             {
    47.                 case "Left":
    48.                     Debug.Log ("ke Left...");
    49.                     offset.x = offset.x + 10;
    50.                     cameraMover.transform.DOMoveX (offset.x, 1, false);
    51.  
    52.                     break;
    53.                 case "Right":
    54.                     Debug.Log ("to Right...");
    55.                     offset.x = offset.x - 10;
    56.                     cameraMover.transform.DOMoveX (offset.x, 1, false);
    57.                     break;
    58.             }
    59.  
    60.         }
    61.         //later::Debug.LogFormat("Swipe state: {0}", gesture.State);
    62.     }
    63.  
    64.     //callback event for Tap Detection
    65.     private void Tap_Updated(GestureRecognizer gesture, ICollection<GestureTouch> touches)
    66.     {
    67.         if (gesture.State == GestureRecognizerState.Ended)
    68.         {
    69. //            Debug.Log("Tap");
    70.         }
    71.     }
    72.  
    73. }
     
  4. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,464
    Looks like you started with the code in DemoSceneSwipe, which is working for me. Do you have any UI elements in your scene? Panels or buttons? You can always email me your project and I can take a look (support@digitalruby.com). If you can't email then we can Skype, email me for contact details.
     
  5. zukinet

    zukinet

    Joined:
    Oct 30, 2016
    Posts:
    51
    yes, i have UI elements, i am using Doozy UI Library , you can see 3D performance status here :



    Are something wrong here ?

    i will email / skype you soon...
     
  6. zukinet

    zukinet

    Joined:
    Oct 30, 2016
    Posts:
    51

    Hi,

    any update ?

    What's your opinion about Doozy UI ?
    Are they slow down my finger performance ?

    thanks
     
  7. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,464
    I have never used Doozy UI, the easiest thing is to disable it and see if your touch performance improves.
     
  8. Designgreen

    Designgreen

    Joined:
    Aug 8, 2017
    Posts:
    1
    I've just started using this asset, and it's great! I'm using it my game, but there is one scene where I'd like to disable it. Is that possible?
     
  9. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,464
    Just disable the prefab game object, or if you have just dragged FingersScript on to your own object, set the script "enabled" to false.
     
  10. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,464
    Hello everyone! I just posted Fingers 1.9.0 to the asset store. This is a great upgrade that adds more demos, and more importantly component gesture scripts. Now you can create gestures right in the editor via Component -> Fingers Gestures -> Gestures -> *.

    In addition, the prefab is now in the resources folder and created automatically, so you don't need to drag it in your scene and you don't need to reference it and create it in any scripts. You are still welcome to drag the prefab in your scene and it will use it if it finds it in the scene, but it's much easier to not mess with it.

    I hope this saves everyone from writing too much boilerplate code.

    - Jeff
     
  11. TheSky

    TheSky

    Joined:
    Feb 16, 2015
    Posts:
    46
    Hello Jeff,

    I would like to achieve a certain behavior for a new project.
    I would like to be able to perform several swipe-gestures in a row without taking the finger off the display.
    By setting EndImmeditely to True, it is possible to recognize several swipe-gestures in a row without taking your finger off the display. So exactly what I want.
    However, I can only recognize every gesture once.
    For example, you can first recognize "gesture A" and then "gesture B".
    However, it is not possible, for example, to first recognize "gesture A", then "gesture B" and again "gesture A".
    The second time, gesture A will not recognized.
    Is there a way to achieve such behaviour?

    Thanks
    Christian
     
    Last edited: Oct 23, 2017
  12. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,464
    Seems reasonable. I’ll have to make a demo scene in a future update.
     
  13. TheSky

    TheSky

    Joined:
    Feb 16, 2015
    Posts:
    46
    That would be really great.
    Thanks a lot.
     
  14. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,464
    The DemoSceneSwipe will have this in the update. I exposed the ResetState for FingersScript. If you call this when your gesture ends, then the touches can begin again even without lifting the finger or mouse.
     
  15. Schizoid2k

    Schizoid2k

    Joined:
    May 6, 2015
    Posts:
    40
    I purchased this asset a couple of weeks ago and it is great... definitely a time saver.

    I am wondering if there is a way to add multiple objects to the Gesture View of a component. For example, I have a level select scene that has 10 buttons, and they all point to the same tap callback. Right now, it appears I have to create 10 tap components.. one for each button.

    thanks!
     
  16. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,464
    That is up to you. 10 tap gestures is fine, but you could also create just one tap gesture and raycast out to see which button it hit (if any). Totally up to you, either way is fine.
     
  17. Schizoid2k

    Schizoid2k

    Joined:
    May 6, 2015
    Posts:
    40
    I never considered that as an option, but that makes the most sense.
    Thanks!
     
  18. TheSky

    TheSky

    Joined:
    Feb 16, 2015
    Posts:
    46
    Hi, I've had a little problem since the latest update.
    The asset works no longer when I run the scene directly on the smartphone. (Samsung Galaxy S2).
    Also in the Demo scenes.
    The scenes are executed without any problems, only the gestures are no longer recognized.
    On the PC in the editor everything works without problems.
    No error messages or the like.
    With a previous version, everything works without problems.
    I still have the 1.7.5 version for direct comparison here, but I know that even with the version 1.9.0 everything worked.
    So the problem only affects version 1.9.1.
     
  19. Arctous

    Arctous

    Joined:
    Aug 25, 2014
    Posts:
    26
    Hello!
    Was there any outcome of this question? I, too, am using multiple cameras in my scene (all of which need to interact with UI and 3D objects). It appears that both FingersDragDropScript and FingersPanRotateScaleScript have a public variable named "Camera" (which defaults to Camera.main, if null). Additionally, ImageAutomationScript uses "Camera.main" directly.
    Thanks for your time!
     
  20. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,464
    I've sent a fix for this, hoping Unity will approve soon...
     
  21. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,464
    I'd suggest making a new gesture for each camera.
     
  22. Arctous

    Arctous

    Joined:
    Aug 25, 2014
    Posts:
    26
    Thanks for the reply! I can make a camera "factory" and load up the gestures that I use for the different cameras that I need. So, I can make that part work. However, how is the ImageAutomationScript going to behave?
     
  23. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,464
    FYI All 1.9.2 is available and fixes touches on actual hardware. I apologize for this bug, but am glad Unity finally posted the fix.
     
  24. TheSky

    TheSky

    Joined:
    Feb 16, 2015
    Posts:
    46
    Thank you. Just tested it. All the touches are now correctly recognized again.
    Unfortunately, the update in the behavior of the swipe gestures that you introduced in version 1.9.1 doesn't seem to work anymore.
    By this I mean that you can no longer perform multiple swipe gestures in a row without taking your finger off the display. Even in the DemoSceneSwipe-Scene it does not work anymore.
    Did you undo this behavior? That would be a pity.
     
    Last edited: Nov 2, 2017
  25. TheSky

    TheSky

    Joined:
    Feb 16, 2015
    Posts:
    46
    Hello, i detected another little Problem.
    It seems that using ResetState() also has an effect on the recognition of gestures, even if you take your finger off the screen between them.
    This affects swipe-gestures with different direction-values. (I've only tested swipe gestures so far)
    For example, I created two swipe gestures. One with
    SwipeGesture.Direction = SwipeGestureRecognizerDirection.Left
    and one with
    SwipeGesture.Direction = SwipeGestureRecognizerDirection.Rigth.
    Now, once a gesture is detected and ended, FingersScript.instance.ResetState() is called. (as it is done in the DemoSceneSwipe)
    If you now swipe in different directions, e.g. first to the left and then to the right, the gestures are not always recognized.
    If the same gesture is called sequentially, there is no problem with the detection.
    Without ResetState() everything works without problems.
    The problem only affects touch input on the smartphone. With mouse everything works without problems.
     
    Last edited: Nov 2, 2017
  26. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,464
    Let's continue this via email, support@digitalruby.com so I can give you a build of the asset to test. I've fixed the swipe without lifting finger problem.
     
  27. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,464
    Let's continue this offline at support@digitalruby.com
     
  28. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,464
    Just a refresher for everyone, I've recently created component gestures. This should eliminate most of the scripting needed to setup gestures. I've also made a component for that camera rotate demo that Unity did in the twitch.tv demo. Feel free to email me if you can't find it.
     
  29. Jrawry

    Jrawry

    Joined:
    Mar 24, 2017
    Posts:
    3
    Hi I just got the package and I'm having trouble using the drag and drop feature on 3D objects. I noticed the script is set to work with 2D rigidbodies and sprites. Is there a recommended way to use this feature on 3d objects?
     
  30. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,464
    There is a scene that drags and drops, scales and rotates 3D objects. Let me know if you have trouble finding it. It's called DemoSceneUIPlus3DElements.
     
  31. Jrawry

    Jrawry

    Joined:
    Mar 24, 2017
    Posts:
    3
    Maybe I missed something, but when I looked at that scene I only saw the ability to pan and rotate elements, not drag and drop. I'm also unable to replicate it by just adding the same component to my object.
     
  32. Jrawry

    Jrawry

    Joined:
    Mar 24, 2017
    Posts:
    3
    A little further playing around and I noticed I can drag with two fingers, I was hoping there was a way to drag the object with just one finger.
     
  33. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,464
    Looks like I already added the PanMinimumTouchCount property, try setting it to 1, let me know how it goes. Email support@digitalruby.com for further issues.
     
  34. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,464
    Fingers - Touch Gestures is on sale now for 30% off. Get it while it's hot!
     
  35. blacksun666

    blacksun666

    Joined:
    Dec 17, 2015
    Posts:
    214
    Could this asset be used to pickup gestures on the touch pad of playstation PS4 controller?
     
  36. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,464
    Sure, but a touch adapter would have to be written, unless Unity sends those touches to the Touches class automatically.
     
    Last edited: Nov 29, 2017
    blacksun666 likes this.
  37. ZzappSizzler

    ZzappSizzler

    Joined:
    Jan 15, 2017
    Posts:
    33
    Hi,

    I bought Fingers yesterday. I am writing a 2D platformer. I am getting inconsistent results with my own touch handler (Unity Editor is fine, iOS build misses single taps) and Fingers looked like a good solution. The way I control my character on a touch screen is simple, if the left side of the screen is held then he goes left, if the right then he goes right. To jump a simple tap on the other side of the screen initiates the jump. I have just discovered that a tap is only detected when a double tap fails. This is useless for me, I need to detect a jump in milliseconds. Is there an easy way to detect a single tap without this delay?
    Thanks,
     
  38. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,464
    A tap does not have to have a double tap to fail. That is optional. Do you have a double tap gesture in your game?
     
  39. ZzappSizzler

    ZzappSizzler

    Joined:
    Jan 15, 2017
    Posts:
    33
    Thanks.
    No I don't.use double tap. Where do I find this option?
     
  40. svanderbeck

    svanderbeck

    Joined:
    Oct 23, 2017
    Posts:
    17
    We are building a touch table app with 4 user quadrants. Would this asset support multiple users zooming and panning at the same time? Not sure if simultaneous gestures refers to one zoom and pan at the same time, or the ability for multiple pan and zooms to be happening at the same time. Thanks!
     
  41. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,464
    There is an option to allow multiple gestures at the same time, try setting ClearTrackedTouchesOnEndOrFail to true on each of the 4 gestures and make sure to allow the gestures to execute simultaneously with each other.
     
  42. CamillaItalicDk

    CamillaItalicDk

    Joined:
    May 14, 2015
    Posts:
    8
    Hi, I have a few questions:
    1. When I add a double-tap-gesturerecognizer I get a delay on the single-tap-gesturerecognizer-callback is it possible to remove that delay?
    2. Is it possible to keep the first single-tap-callback when double-tapping after I have added the double-tap-gesturerecognizer?
    3. When the game starts there is a delay before I get tap-callbacks. Is it possible to remove it?

    Looking forward to your answers.
     
  43. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,464
    1] No, because the system can't predict the future in whether there will be a double tap or not. It has to wait for the double tap to fail.
    2] Are you wanting to be notified that the single tap is waiting for the double tap to fail? I think you can just check for the EndPending state, let me know if you run into issues.
    3] Not sure what is causing this, but nothing in the code intentionally introduces a delay. How long is the delay?
     
  44. CamillaItalicDk

    CamillaItalicDk

    Joined:
    May 14, 2015
    Posts:
    8
    Thanks for your answers.
    2. I don't get an EndPending stateI I get a Possible state and a Failed state. The Possible state might be a solution but right now I use Unity's touch system to find out when the touch starts.
    3. The delay in the beginning was my mistake. I have an image that fades in.
     
  45. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,464
    I may not be sending the EndPending state, I will fix that in a future update.
     
  46. valnei

    valnei

    Guest

    Hi,
    Is it possible to set a object with sprite renderer to Gesture View instead of a canvas object? I would like to check a gesture in a specific object without using canvas.
    Thanks.
     
  47. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,464
    You can assign any game object as a platform specific view. The game object needs a collider of some kind.
     
  48. gferrari

    gferrari

    Joined:
    Jan 14, 2015
    Posts:
    135
    I'm sorry to come up with a silly question, I want to limit the panning on the X axis, how do I stop it?

    upload_2018-1-21_0-43-8.png
     
  49. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,464
    Vector3 pos = camera.transform.position;
    pos.x = Mathf.Clamp(pos.x, min, max);
    camera.transform.position = pos;
     
    John-G and gferrari like this.
  50. hexaust_

    hexaust_

    Joined:
    Mar 7, 2015
    Posts:
    23
    Hi there, I am having some issues with the SwipeGesture. I used the code from the swipe scene demo and for some reason I can't get the swipe state to end, the only states that I get are Failed and Possible. Everything works fine in the demo scene. Is there something that I should look for?

    Thank you.