Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

[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. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,190
    Input.touchCount or Input.touches?
     
  2. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,190
    Try calling JoystickScript.PanGesture.Reset, let me know how it goes...
     
  3. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    202
    No, didnt help. Maybe this will help you, help me?

    Debug.Log("Instance before: " + FingersScript.Instance.GetInstanceID());
    result: instance before: -944096

    app interupted .....
    .... app resumed.

    Debug.Log("Instance after: " + FingersScript.Instance.GetInstanceID());
    result: instance after: -944096

    Do I somehow have to remove this instance? If yes, how.
     
  4. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,190
    You could call FingersScript.Instance.ResetState(false) or even FingersScript.Instance.ResetState(true) then re-add the joystick prefab and any other gestures you want.
     
  5. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    202
    Debug.Log("Instance before reset: " + FingersScript.Instance.GetInstanceID());
    FingersScript.Instance.ResetState(true);
    Debug.Log("Instance after reset: " + FingersScript.Instance.GetInstanceID());

    still shows the same instance id. (exact same result if I use FingersScript.Instance.ResetState(false);

    I created a work around, however I needed to add it to fingersjoystickscript, which is something I don't want to do.

    public void resetjoystickimage()
    {
    SetImagePosition(startCenter);
    }

    I then call resetjoystickimage. This helps reset the joystick to center, however the joystick is still recognizing the last position, so the character keeps on moving in the previous direction. Not perfect however it fixes my main issue.
     
  6. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,190
    The reset method will not change the instance id. I will look at adding a proper reset method to the joystick script in next update soon.
     
  7. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,190
    Code (CSharp):
    1.         public void Reset()
    2.         {
    3.             PanGesture.Reset();
    4.             SetImagePosition(startCenter);
    5.             lastMoveJoystickToGestureStartLocation = false;
    6.         }
     
  8. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,190
    Update is sent, look for it in a few minutes - 2.7.4.
     
  9. jrDev

    jrDev

    Joined:
    Nov 5, 2008
    Posts:
    1,701
    Hello,

    Any Playmaker support?

    Thanks,
    jrDev
     
  10. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    202
    Thanks its working. BTW - The support you provide is unnaturally quick.
     
  11. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,190
    Glad it is working! No playmaker support currently.
     
  12. jrDev

    jrDev

    Joined:
    Nov 5, 2008
    Posts:
    1,701
    Dang, ok. Will have to wait then.

    Thanks,
    jrDev
     
  13. Falondrian

    Falondrian

    Joined:
    Dec 4, 2018
    Posts:
    33
    Small request: Could you replace the DPI warning by an info log? We have a zero warning policy and while I love your frequent updates, I always have to remove it manually. Bonus: Allow to register a log callback so I can route the logs through our own logging system, not so important though :)
     
  14. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,190
    I refreshed the same version with an info log. Try a re-download in about an hour.
     
    Falondrian likes this.
  15. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    477
    Have anyone faced the problem that on PC (in editor) pressure which is not supported constantly return 0 instead of 1 as unity does if pressure is not supported?
     
  16. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,190
    I've not heard of that but it could very well be a bug in Unity. I just pass along the Unity touch object pressure...
     
  17. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,190
    I've sent a refresh update that defaults pressure to 1.0 for mouse touches.
     
    nicloay likes this.
  18. Romano

    Romano

    Joined:
    Nov 27, 2013
    Posts:
    70
    Hi, apologies for the repost but still haven't been able to find an answer to this one:

    Hi there, I was wondering if there was an easy way to use swipe gestures simultaneously with image recognition? This is to allow the player to control a character with swipes and also to draw images for special actions. The problem I have is that swipes happen midway through an image being drawn. I thought I would be able to use something like:

    Code (CSharp):
    1. swipeGesture.AddRequiredGestureRecognizerToFail(imageRecognitionScript);
    But it seems that the image recognition script (or at least the one called
    FingersImageGestureHelperComponentScript) isn't a GestureRecognizer in the same way the other scripts are.

    Currently I'm using coroutines to delay the swipe action until after the player has lifted a finger to check if something has been drawn first, but this is introducing a delay and is quite fiddly to work with.

    Would appreciate any help you can give me, thanks! I just bought the asset and I'm loving it so far. Sorry if this turns out to be a noob question...
     
  19. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,190
    Image recognition gesture does not have a good way to fail unfortunately. Like a pan gesture, it will execute happily until the finger is lifted.

    Probably the best is to allow simultaneous execution, and call Reset on the image gesture if the swipe gesture executes.
     
    Romano likes this.
  20. Falondrian

    Falondrian

    Joined:
    Dec 4, 2018
    Posts:
    33
    Hi, I am using Fingers together with InControl by using the VirtualTouchObjectHandler, hence TreatMousePointerAsFinger and ProcessUnityTouches are disabled. However, with this the mouse scrollwheel doesn't work anymore. Can you make it work with these flags disabled? You could also allow to set a callback for querying the mousewheel, however in my case I would just give you the unity input.
     
  21. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,190
    Download 2.7.5, I split up the mouse pointer into a new mouse wheel boolean on fingers script. Now you can have just a mouse wheel without a mouse pointer.
     
    Falondrian likes this.
  22. giggioz

    giggioz

    Joined:
    May 11, 2017
    Posts:
    30
    Hi jjxtra,

    I was looking for a gesture recognizer and I found this asset.
    I saw the tutorial and I understood how to teach the system with my own gestures.

    Basically, in my game, I want to allow the player to trace magic symbols on the screen and this will trigger some internal mechanics.

    Is it possible to create some particles effects and trails during the player gestures to improve the visual quality of the action?

    I still don't have the asset so I did not have the chance to explore the code or make some experiments to figure it out on my own.

    If the answer is yes, could you give some more information on how to do it?
    Thanks a lot!
     
  23. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,190
    Unity particle system and trail system is your best friend here. Just convert gesture screen coordinates to world coordinates, set the particle position and and call emit on the particle system.
     
  24. DreamerYinYu

    DreamerYinYu

    Joined:
    Apr 14, 2018
    Posts:
    21
    Hello, I want the camera to rotate and zoom around the earth.I want to limit the rotation of the camera to the Antarctic or the Arctic so that it does not cross. What shall I do? Thank you very much.
     

    Attached Files:

  25. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,190
    Probably a simple pan gesture with a transform orbit around call in your script. You can clamp the position and/or angle easily enough in a custom script.
     
  26. DreamerYinYu

    DreamerYinYu

    Joined:
    Apr 14, 2018
    Posts:
    21
    Hello! I set "Orbit X Max Degrees" to "90" and succeeded in limiting the main camera, which would not cross the North and South Poles.

    The main camera is in position A. When the scene starts, I want the main camera to see China. So I set the camera position and rotation through the code. The problem is that the main camera can cross the North and South Poles again!

    I want the main camera to see China, and I don't want it to cross the North and South Poles. How do I dynamically set the camera position and rotation? Thank you very much.
     

    Attached Files:

    • 1.PNG
      1.PNG
      File size:
      52.1 KB
      Views:
      139
    • 2.PNG
      2.PNG
      File size:
      676.6 KB
      Views:
      117
    • 3.PNG
      3.PNG
      File size:
      695.8 KB
      Views:
      616
    • 4.PNG
      4.PNG
      File size:
      16.9 KB
      Views:
      132
    • 5.PNG
      5.PNG
      File size:
      648 KB
      Views:
      126
  27. DreamerYinYu

    DreamerYinYu

    Joined:
    Apr 14, 2018
    Posts:
    21
    I use gesture and mouse control in my project at the same time. Is mouse operation detected through this plug-in? Which interface detects the mouse?
     
  28. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,190
    Do you mean touches and mouse control? By default the mouse will generate a touch for the mouse pointer.
     
  29. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,190
    Fingers 2.7.8 is out and includes much improved virtual touch handling. Please see DemoSceneVirtualTouches and DemoScriptVirtualTouches. I've revamped the architecture a bit and improved things. If you get this update and use virtual touches, you will need to do some tweaks based on the new DemoScriptVirtualTouches.
     
    Falondrian likes this.
  30. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,190
    You will need to create a script that clamps the camera position and/or rotation.
     
  31. alsomitra

    alsomitra

    Joined:
    Aug 31, 2017
    Posts:
    21
    Hello
    I need an interface like GoogleMap APP.

    ・ "Filck" Pan Gesture moves the map using inertia, and "Swipe" Pan Gesture moves the map by the amount of swipe without using inertia.
    ・ "Filck" Tilt Gesture tilts the map using inertia, and "Swipe" Tilt Gesture tilts the map by the amount of swipe without using inertia.
    ・ "Filck" Scale Gesture expands the map using inertia, and "Swipe" Scale Gesture expands the map by the amount of swipe without using inertia.
    ・ "Filck" Rotate Gesture rotates the map using inertia, and "Swipe" Rotate Gesture rotates the map by swipe without using inertia.

    ・Each inertia stops when you tap it during Swipe.

    How should I implement it with Fingers?
    Do you have a good sample?

    Thank you.
     
  32. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,190
    There is a demo scene DemoSceneCameraMove3D that is your closest bet, you can pan, pinch rotate or zoom and two finger pan to tilt. It is similar to Google Earth / Maps, a good starting point. All gestures in that scene have inertia.
     
  33. laurie71

    laurie71

    Joined:
    Aug 15, 2018
    Posts:
    37
    Quick question: where is the documentation for Fingers? The Support website and Publisher website links in the Asset Store go to the same webpage, and clicking on Fingers there just goes back to the Asset Store... The asset info links to an old-school mailing list, various demos, Discord and here. Are there "quick start" / "quick reference" / "api reference" docs somewhere that I'm just not finding?
     
  34. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,190
    The best documentation right now are the demo scenes and demo scripts and of course ask me anything. I’ll try to get an html doc up somewhere soon of all the classes and methods.
     
  35. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,190
    You can also download and play with the free version if you just want to try the code gestures and see if it’s a good fit.
     
  36. laurie71

    laurie71

    Joined:
    Aug 15, 2018
    Posts:
    37
    I have the full version already, but I was bootstrapping a new project and didn't want to repeat all the exploration I did on first using Fingers. In the end I just referred back to the previous project to refresh my memory. That got me up and running on the new project.

    Even so, I'm betting there's a lot more functionality than I've discovered so far since I haven't picked apart every one of the demo scenes and scripts. More accessible documentation would be helpful.
     
  37. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,190
    I'm using sandcastle right now to generate some html docs, I will post a link when they are online.
     
    Last edited: Aug 30, 2019
  38. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,190
    All my documentation is going to live here now:

    https://digitalruby.github.io/Manuals/

    Right now fingers gestures is the only asset, but I will be adding Weather Maker, Procedural Lightning and Fast Line Renderer in the future.
     
  39. laurie71

    laurie71

    Joined:
    Aug 15, 2018
    Posts:
    37
    Awesome, thanks for posting that; I'll take a look after the weekend!
     
  40. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,190
    You're welcome, it should have every class, function and property in a nice html format.
     
  41. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    698
    Hi @jjxtra,

    I'm facing a situation which I can't grasp. I'm using the virtual joystick as input and a gesture so tap will be a fire action.
    While the player is moving the tap for fire isn't executed. I got it working to some extend when setting ClearTrackedTouchesOnEndOrFail to true. However this seems to be interrupting the joystick movement. Any idea on how to solve the moving and tap at the same time?

    Code for the fire gesture:
    Code (CSharp):
    1. fire1Gesture = new TapGestureRecognizer();
    2.         fire1Gesture.StateUpdated += TapGestureUpdated;
    3.         fire1Gesture.AllowSimultaneousExecutionWithAllGestures();
    4.         fire1Gesture.ClearTrackedTouchesOnEndOrFail = true;
    5.  
    6.         FingersScript.Instance.AddGesture(fire1Gesture);
     
  42. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,190
    Sounds like a bug. I will add a tap to the joystick demo scene and make sure it works and post back.
     
  43. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,190
    I refreshed the latest 2.7.8 update, please re-import from asset store and try the demo scene joystick with tap. The tap will rotate the square slightly. DemoScriptJoystick.cs is the script.

    Let me know how it goes...
     
  44. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    698
    Seems to be working fine now, thanks!
     
  45. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,190
    Awesome, post some screenshots of your game if you have time :)
     
  46. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,190
  47. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,190
    Fingers Gestures 2.8.0 is out, I am starting to add a full projects folder and the first project is a word game where you can drag letters around and make words. It is work in progress, will update and add more stuff as I have time.
     
  48. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    698
    Hi @jjxtra, had to rework my mobile UI to match more the type of game so I kicked out the previous working joystick and went for a dpad like method and I'm facing an issue. What I did is using the dpad script as temple but my 'controls' are skattered accros the UI. So the left move is on the left of the screen, right move on the right and up and down somewhere in the middle. Everything seems to working fine but I notice when running even when removing my figure from the dpad images the movement is still happening until I tap somewhere else on the screen. Is there a way to let the movement stop when removing my figure from the dpad image? I tried setting the horizontal and vertical movement to 0 on gesture end or failure but that doesn't seem to work properly. (I'm using the crossplatforminput so both those fields are set). Running on Unity 2019.2.3f1.
     
  49. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,190
    So if the finger is still down but moves off you want it to not move?
     
  50. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    698
    No, the finger is off the device but the player object continues moving in the last direction set. For some reason the gesture end or failure isn't always captured.
     
unityunity