Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[RELEASED] FingerGestures - Robust input gestures at your fingertips!

Discussion in 'Assets and Asset Store' started by Bugfoot, Jul 8, 2011.

  1. Bugfoot

    Bugfoot

    Joined:
    Jan 9, 2009
    Posts:
    533


    FingerGesture is a scripting package for Unity that lets you easily detect and react to input gestures performed with either a mouse or a touch screen device. Available now on the Unity Asset Store

    Latest Update: v3.0
    Features | Docs | Online Demo | Forums

    Change Highlights in v3.0
    • Major architectural revamp: more intuitive, flexible and responsive
    • Custom gesture recognizer
    • Built-in scene object picking
    • Support for message-based event notifications using Unity’ SendMessage API
    • Brand new PlayMaker actions
    • Support for retina displays
    • Twist gesture emulation on desktop

    Intended Audience
    This package is targeted at users having at least a basic knowledge of unity programming. The scripts provide you with an easy-to-use API that takes care of detecting various input gestures events, but you will still have to code your own logic in reaction to these events. However, for the non-coders out there, the toolbox scripts will still allow you to use some features of the library without any coding required.

    I'm looking forward to hear your feedback on FingerGestures!

    Important Note: I do not check this thread very often, so please use the official FingerGestures forum for support requests!
     
    Last edited: Mar 20, 2013
  2. ProjectOne

    ProjectOne

    Joined:
    Aug 9, 2010
    Posts:
    442
    Great timesaver
     
  3. Bugfoot

    Bugfoot

    Joined:
    Jan 9, 2009
    Posts:
    533
    It does save time indeed! Simply drag the "Finger Gestures Initializer" prefab in your scene, then register to the input gesture events you are interested in on the FingerGestures singleton, from your script. Finally, add your own logic to react to the event, and you're done ;)
     
    Last edited: Jul 9, 2011
  4. AnomalusUndrdog

    AnomalusUndrdog

    Joined:
    Jul 3, 2009
    Posts:
    1,551
    rotate gesture and pinch-to-zoom gesture is really all I'm looking for
     
  5. Bugfoot

    Bugfoot

    Joined:
    Jan 9, 2009
    Posts:
    533
    The two-finger twist/rotation gesture is at the top of my todo-list for the next version ;)
     
  6. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,293
    When will it be in the store?
    What kind of features are planed for updates besides the two-finger twist/rotation geture?
     
  7. Bugfoot

    Bugfoot

    Joined:
    Jan 9, 2009
    Posts:
    533
    The package is still pending review, but hopefully it will be approved sometime soon this week.

    In term of planned updates beside the twist gesture: I don't have anything more planned at the moment, beside a possible spline-based customer gesture recognizer. It will be mostly dependent on the feedback and feature requests I get down the line. Was there anything in particular you were looking for?
     
  8. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    Awesome! Just what I am looking for! Thanks!
    Oh just one question - how much is it?
     
    Last edited: Jul 12, 2011
  9. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,293
    $25 in the beginning like he wrote in the first post.
     
  10. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    Oh LOL, strange I miss that. ;p
    Hmm, $25, definitely! I am already your new customer! :D
     
    Last edited: Jul 12, 2011
  11. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,293
    I am with I am da Bawss, just waiting that i can buy it in the store :)
     
  12. Bugfoot

    Bugfoot

    Joined:
    Jan 9, 2009
    Posts:
    533
    Thanks for your interest, I'm also eagerly waiting for my package to finally be approved by Unity ;) It shouldn't be much longer now!
     
  13. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,293
    Me too,

    i reload the store every five minutes since the last days ;)
     
  14. Bugfoot

    Bugfoot

    Joined:
    Jan 9, 2009
    Posts:
    533
    Great news, the package has just been released on the Asset Store!
    The big banner doesn't show up properly so I'm checking with Unity to see what's up with that.
     
  15. Bugfoot

    Bugfoot

    Joined:
    Jan 9, 2009
    Posts:
    533
    I've updated the original post with the following note/disclaimer:

    NOTE: Using this package requires at least a basic knowledge of unity programming. The scripts provide you with an easy-to-use API that takes care of detecting various input gestures events, but you will still have to code your own logic in reaction to these events. However, In the next update, I plan on providing ready-to-use scripts that you can drag on your objects to get some often-use functionality such as drag drop.

    I apologize if this wasn't clear enough. Thanks to your feedback though, I now have some good ideas on additions that will make it much easier for non-programmers to also benefit from future versions of FingerGestures.
     
  16. ProjectOne

    ProjectOne

    Joined:
    Aug 9, 2010
    Posts:
    442
    good to hear it's out... I guess i will need it soon :)
     
  17. AnomalusUndrdog

    AnomalusUndrdog

    Joined:
    Jul 3, 2009
    Posts:
    1,551
    Suggestion: Can you make your code recognize two-finger straight swipes and additionally be able to recognize them differently from two-finger pinch and two-finger rotate gestures?
     
  18. Bugfoot

    Bugfoot

    Joined:
    Jan 9, 2009
    Posts:
    533
    I've been thinking of adding a more advanced system to the library where you can provide custom gesture recognizers that you setup the way you want and register on the FingerGestures singleton. That might be necessary in order to support more elaborate gestures that are not so common and to keep the API simple for the less advanced users.That could be one way of handling multiple-fingers gestures such as your two-finger swipe.

    I also plan on improving the pinch algorithm a bit so it makes sure the fingers are moving in opposite directions or toward to each other. Right now it's a bit too permissive on that front :)
     
  19. kheng

    kheng

    Joined:
    Oct 22, 2008
    Posts:
    126
    not found..... Has it been taken down?
     
  20. Bugfoot

    Bugfoot

    Joined:
    Jan 9, 2009
    Posts:
    533
    Not to my knowledge. Might be something temporary, ill look into it.
     
  21. Bugfoot

    Bugfoot

    Joined:
    Jan 9, 2009
    Posts:
    533
    Apparently, for some mysterious reason, the package has indeed vanished from the asset store, without any notice. I've contacted unity to enquire about this.
     
  22. Bugfoot

    Bugfoot

    Joined:
    Jan 9, 2009
    Posts:
    533
    Ok it's now up again. The Unity asset store team was quick to answer and address the problem, so big thanks to them ;)
     
  23. Bugfoot

    Bugfoot

    Joined:
    Jan 9, 2009
    Posts:
    533
    Good news! I've just submitted an update (v1.2) to the asset store, and it's now pending review. I've been working hard on it this week and am very happy with the result. Here are some of the main changes (scroll down for the web player demo).

    GENERAL
    * Added two-fingers rotation gesture
    * Added long-press gesture
    * Reworked the samples from scratch:
    --> The original monolithic sample has been split up in smaller ones that are easier to follow and more focused
    --> Added a selection menu listing samples in a progressive order
    --> Each sample now uses a common UI framework to display help and get back to selection menu
    --> Added samples demonstrating the new input gestures and events in a progressive way
    * Added a Toolbox folder with ready-to-use scripts to quickly add Drag Drop support to your application
    * Pinch gesture now requires that the fingers move in opposite directions (tolerance threshold adjustable via TouchScreenGestures.pinchDOT)
    * Added skeleton C# code in Assets/FingerGestures/Skeleton Code/CSharpSkeleton.cs
    * Renamed JavascriptSkeletonCode.js to JavascriptSkeleton.cs and moved it to the Assets/FingerGestures/Skeleton Code/ folder
    * Updated JavascriptSkeleton.js to reflect latest API changes

    API CHANGES
    * Added OnFingerStationaryBegin and OnFingerStationaryEnd events
    * Added OnFingerMoveBegin, OnFingerMove, OnFingerMoveEnd events
    * Added OnLongPress event
    * Added OnRotateBegin, OnRotateMove, OnRotateEnd events
    * Renamed dragThreshold to moveThreshold
    * Added longPressDuration, pinchDOT, minPinchDistance, rotationDOT and minRotationAmount thresholds to TouchScreenGestures public properties

    BUG FIXES
    * Fixed moveThreshold not being taken into account properly by some gestures
    * Fixed finger mapping bug when releasing multiple fingers at different times

    You can try a webplayer version of the new samples here.
    I've also added some screenshots of them in action on my iPad below:











     
    Last edited: Jul 22, 2011
  24. p6r

    p6r

    Joined:
    Nov 6, 2010
    Posts:
    1,158
    WOW ! It should be very interesting... but i have a question :
    Can a newbie simply attach a script on an object ? And it works !?!
    Or do we have to add some script lines !?!
    Im' not sure to have understood very well in english how it works...

    thanks
    6R
     
  25. Bugfoot

    Bugfoot

    Joined:
    Jan 9, 2009
    Posts:
    533
    Well the scripts that are meant to be "attach script > hit play > it works" are new in v1.2 and are located in the Toolbox folder. They're a bit of an early experiment still, based on some feedback I have received so far. Right now, the toolbox only gives you Drag Drop out-of-the-box and it's meant for 3D objects only (collider-equipped GameObjects you want to move around). It won't work with GUIText/GUITexture at the moment.

    But if you want to use the rest of the package, you will still have to write a little bit of code on your own. However, I've designed the API in a way that keeps the amount of boiler-plate code you need to write to the minimum: all you need to do is subscribe to the input/gesture events you are interested in, and write your own code to react to them.

    So in a nutshell: FingerGestures is targeted at people with at least a basic knowledge of programming in Unity. Using FingerGestures is very easy and well documented, but you will have to write a bit of code on your own, unless you only plan on using scripts from the Toolbox.
     
  26. p6r

    p6r

    Joined:
    Nov 6, 2010
    Posts:
    1,158
    Thanks for your answer Spk...

    For me, it depends also on what you mean with "a bit of code" !?! :)
    Maybe you could make 2 packages : one (cheap !) with only the toolbox options very easy to use for beginners. And one with all functions !
    Customers who already had purchased the toolbox version could buy the rest of the full package in the future when they have learned a little bit more Unity3D !?!

    6R
     
  27. Bugfoot

    Bugfoot

    Joined:
    Jan 9, 2009
    Posts:
    533
    That would be a difficult thing to do as the toolbox scripts use the core FingerGestures API, so you can't really have one without the other. And I think you get a lot of value from the package for what its current price.
     
  28. p6r

    p6r

    Joined:
    Nov 6, 2010
    Posts:
    1,158
    I understand...
    You're right if I could use all your Gestures... But if I could use the Toolbox only !?!
    Could you do a beta version for testing ? (Ending in one week for example !?!)

    6R
     
  29. Bugfoot

    Bugfoot

    Joined:
    Jan 9, 2009
    Posts:
    533
    This isn't technically possible (at least not in any simple and convenient way).

    ---

    I updated the original post with the new version info and reorganized the content a bit to be clearer.
     
  30. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    $35 dollars now? Thought its $25.
     
  31. Bugfoot

    Bugfoot

    Joined:
    Jan 9, 2009
    Posts:
    533
    Yeah $25 was the introduction price. $35 is where I wanted it at, in term of content and quality.
     
  32. grfxman

    grfxman

    Joined:
    May 28, 2009
    Posts:
    309
    I have placed this Java Script on some characters running around in my game world. If you double Tap them it is supposed to update the camera position. But double tap doesn't seem to be working. Here is the script I'm putting on each character :

     
  33. onllm

    onllm

    Joined:
    Mar 4, 2011
    Posts:
    111
    multi touch support in there?
     
  34. Bugfoot

    Bugfoot

    Joined:
    Jan 9, 2009
    Posts:
    533
    Yeah multi-touch is fully supported. The Finger Move sample demonstrates this quite well when ran with a touchscreen device.

    Each event of the library provides a fingerIndex as the first parameter that identifies which finger this event originated from. This allows you to differentiate between fingers.
     
  35. Bugfoot

    Bugfoot

    Joined:
    Jan 9, 2009
    Posts:
    533
    By not working, do you mean you're not getting the OnTap event to fire at all, or does it fire regardless of whether you tap the characters or not? If it's the later, this is normal given your current implementation. What you need to do is perform a raycast into the scene from the finger's screen position given to you by the fingerPos in the OnTap event parameters. Take a look at the OneFingerGesturesSample scene and its script for an example of how to do that.

    Also, you can adjust the tapping time/delay directly on the TouchScreen Gestures or Mouse Gestures object (whichever you're using) depending on your situation. There is a maxTapTime property that sets the maximum time that can elapse between two taps before the tap gesture is no longer recognized as a tap.

    I will expand the Toolbox with a Tap script you can put on the objects you want to tap in the next update. Let me know if you're still having problems, ill provide more detailed help.
     
  36. Bugfoot

    Bugfoot

    Joined:
    Jan 9, 2009
    Posts:
    533
    I have just submitted FingerGestures v1.3 and it hit the asset store as soon as it's been approved. In this new version, I have made a big update to the Toolbox, which should make the package even easier to use for people who want to do as little extra coding as possible.

    Here are the main changes and additions to the toolbox:
    - Added TBFingerDown script
    - Added TBFingerUp script
    - Added TBTap script
    - Added TBLongPress script
    - Added TBSwipe script
    - All toolbox gesture scripts now inherit from TBComponent base class
    - TBInputManager: added flags to turn on off tracking of specific gestures
    - TBDrag: updated exposed message properties
    - Added two sample scenes to demonstrate the new toolbox scripts

    As always, your feedback and constructive criticisms are very much appreciated!
     
  37. DFT-Games

    DFT-Games

    Joined:
    Jun 24, 2010
    Posts:
    454
    Hey Will,

    I hope you don't mind me writing this. Honestly it's time to bring up the price ;) This package is a huge time saver and you are working on it making it more complete at every round. It looks to me that this can easily be sold at $50 and that price tag feels just right ;)

    Keep it up!
     
  38. Bugfoot

    Bugfoot

    Joined:
    Jan 9, 2009
    Posts:
    533
    Hey Pino, thanks for the nice words!
    At the moment I feel the price is where it needs to be, but i might kick it up a notch in a future update when I introduce custom gesture recognizers.

    One thing I would really appreciate though is a review or two on the asset store, as that would go a long way in helping convince the yet-undecided customers ;)
     
    Last edited: Aug 1, 2011
  39. DFT-Games

    DFT-Games

    Joined:
    Jun 24, 2010
    Posts:
    454
    You are spot-on about reviews... I've the very same problem with my products on the Asset Store :( Anyhow, I've just added a review on this one ;)
     
  40. Bugfoot

    Bugfoot

    Joined:
    Jan 9, 2009
    Posts:
    533
    The update is now live on the Asset Store, and I've updated the original post to reflect the changes.

    Pino: thank you! ;)
     
  41. ProjectOne

    ProjectOne

    Joined:
    Aug 9, 2010
    Posts:
    442
    Thanks Spk, finally got it :)
     
  42. Bugfoot

    Bugfoot

    Joined:
    Jan 9, 2009
    Posts:
    533
    Good to hear, I hope you'll find it useful ;) And please don't be shy on the feedback, as they will shape the future versions of the package.
     
  43. ProjectOne

    ProjectOne

    Joined:
    Aug 9, 2010
    Posts:
    442
    Hi,
    I just started using it and all I wanted to do was have one of my blocks to move left and right based on finger movement (left/right)

    I followed the instructions to get Unity Remote to work (is this right?):
    1) Added the Finger Gestures Initializer to the scene
    2) In the inspector I dragged TouchScreen Gesture prefab to 'Editor Gestures' (for the Finger Gestures Initializer prefab)

    3) I added to the scene the sample prefab TB Draggable Sphere and I have not changed any settings for it

    4) I added the TBDrag script to my 3D Block (just a scaled cube)

    5) with Remote active on the iPhone4 I clicked on PLAY but cannot drag/move the sphere, nothing happens.

    6) I built and run the game to my iPhone 4, the game of course loads up but cannot drag/move anything

    Maybe what you are missing is some dummy proof :) tutorial/video tutorial of the type Getting Started. Yes there is documentation to code away, but for something that will surely be a Time Saving Asset I would think these sample scripts and prefabs are supposed to get objects moving quickly without coding? then edit their script from there?

    Cheers

    P.S.: also maybe, add a tutorial/video explaining how/why coding using your API/Asset will be easier/savetime compared to write code from scratch to for example move an object left and right with finger gesture on iOS

    These type of samples/tutorials will help with sales I would think
     
    Last edited: Aug 4, 2011
  44. Bugfoot

    Bugfoot

    Joined:
    Jan 9, 2009
    Posts:
    533
    Since you are using some of the toolbox scripts (they start with the TB initials) you also need to add the TBInputManager script to one of your scene objects.

    I've also thought about making some videos and I probably will do that soon when time allows for it. Thanks for the suggestions!
     
  45. ProjectOne

    ProjectOne

    Joined:
    Aug 9, 2010
    Posts:
    442
    Hi, thanks,
    I have added the TBInputManager, on REMOTE still doesn't move. With a proper build I can finally drag the object around but not all the times, it is like if at times the touch and drag does not get detected.

    If I simply want to move this object to where the finger touches the screen... and as I move my finger the objects updates its position to the new finger position shall I play around with your onFingerDown event?
    Get the Vector2 position from onFingerDown and move the object to that position... keep doing that so the object is always moved under the finger... then constrain movement to x only ( I only need left/right movement)

    Or am I going the wrong way?

    (EDIT:)
    In the end it was quicker for me to have a touch based left/right movement coding it myself detecting touchCount, GetTouch delta position and updating the transform of the object I wanted to move. So I guess for now I am missing the point. I know it is just me missing the point and this is a very basic/simple gesture to code without FingerGesture asset (well I still had to work it out, noob coder). So I look forward to your tutorials that show how to use your API to work with more complex situations and what the benefits are compared to using the standard Unity API.

    Keep it up :) I am sure you have a great product, it is just me still learning
     
    Last edited: Aug 5, 2011
  46. oliverdb

    oliverdb

    Joined:
    Jan 30, 2010
    Posts:
    165
    Just bought your fingergestures yesterday and I am trying todo a sideway scroll using Unity GUI. I am using your swipe event as well as the drag event because it seems like thats what apple does (in the integrated) browser.

    But I cannot make them work since a swipe is a beginning of a drag?

    Anyway It would be nice with a demo of a simple apple style sideway scroll using swipe, and also the velocity from the swipe event, what does this number represent.

    Thankyou and keep up the good work
     
  47. Bugfoot

    Bugfoot

    Joined:
    Jan 9, 2009
    Posts:
    533
    Have you tested your application on device too? Unity Remote isn't 100% accurate and depending on your wifi reception and other factors, it might skip some input frames. FingerGestures is resistant to such situations, in the sense that it will fallback to the best possible guess it can make. However, you will occasionally miss some input events while using Unity Remote.

    What you are trying to do isn't something that the Toolbox scripts can provide you. The toolbox scripts are meant to provide convenience/prototyping tools to cover some of the most common needs (drag and drop, etc). To do what you are describing, you'll have to use the FingerGestures API directly by subscribing to its OnFingerDown and OnFingerMove input events, and adding your own logic on top. You can however take inspiration from the toolbox scripts that have some glue code for a bunch of things you'll have to do such as picking the 3D object at a given screen position or dragging an existing object to another position on the screen. Let me know if you need more directions with this.
     
  48. pixelsteam

    pixelsteam

    Joined:
    May 1, 2009
    Posts:
    924
    This looks fantastic, but I am having to be sitting on the fence to wait for the video's. I am a early stage noobie programmer and just want to make sure I have the chops to drive this. The webplayers look great!!!
     
  49. Bugfoot

    Bugfoot

    Joined:
    Jan 9, 2009
    Posts:
    533
    The swipe gesture is essentially a simplified/streamlined drag gesture. So if you're trying to use both, it's going to turn into a bit of a chinese puzzle as you have already noticed :) You have to pick the one that fits your specific scenario best. I think the swipe gesture will be the easiest here as it already gives you a constrained direction and a velocity factor that you can use to scale the amount of motion to apply. The velocity value is the speed in pixels per second of the swipe motion that generated the event. It gives you a good hint at how quick the user swiped his finger in the specified SwipeDirection.

    If you need to do a more customized solution, you will have to use the Drag events and do your own plumbing.

    This is on my todo list for the next update. However, it's not entirely trivial to deal with UnityGUI in this context as the immediate mode design of the GUI framework isn't a very nice fit for the event-driven design of FingerGestures. But worry not, ill come up with something soon ;)
     
  50. oliverdb

    oliverdb

    Joined:
    Jan 30, 2010
    Posts:
    165
    Tell me about it :) I did a drag solution and the felling was "laggy", currently I am using a swipe solution since I here use Itween for animation, which give a much more smooth feeling. The problem is that to the lack of drag I am missing precision control. I will probably have to work on a custom solution using drag only.