Playmaker Forum

PlayMaker Updates & Downloads => Share New Actions => Topic started by: Spk on April 11, 2012, 02:44:04 PM

Title: FingerGestures Actions (Beta)
Post by: Spk on April 11, 2012, 02:44:04 PM
Hi!

I'm the author of FingerGestures (http://fingergestures.fatalfrog.com), a Unity plugin that allows you to detect common input gestures. Due to popular request, I’ve recently been working with Alex on adding support for FingerGestures to PlayMaker, and now have something ready for testing!

I've attached to this post a package with the early beta version of the new FingerGesture actions. At the moment there's only two of them:
- FingerGestureDetectInput allows you to detect all the default gestures supported by FingerGestures (finger down, finger up, tap, double tap, swipe, long press, pinch, rotation...) and generate an FSM event along with output variables you can store some of the gesture data in
- FingerGesturesGetFingerInfo lets you access all the properties of a specific finger (position, delta position, touch status, touch start time, etc)

It also comes with built-in support for interacting with scene objects via gestures, which should make it quite easy to work with. For instance, you can have the tap gesture event fire only if a specific object was tapped.

I would really appreciate if some of you with access to FingerGestures could give this a try and give me some feedback here.

Thanks in advance! :)

---

UPDATE: v0.3
- Made the FingerGesturesDetectionInput stateless when it comes to handling continuous gestures such as drag, pinch and rotation.
- Added "Must Hit Object" property to the FingerGesturesDetectionInput action to require a valid object to be present under the finger(s) for events to fire
- Added support for dragging objects via the FingerGestureDragObject action. See "Playmaker Drag" sample scene in the Samples folder.
- Added "Playmaker Tap" sample in the Samples folder

UPDATE: v0.2
- Added Ignore Layer property to FingerGesturesDetectInput action to ignore colliders in specific layers when raycast for objects under the finger
- Removed left-over raycast in FingerGesturesActionHelpers.PickObject()
Title: Re: FingerGestures Actions (Beta)
Post by: Lars Steenhoff on April 12, 2012, 03:13:11 PM
I'm gonna try this out in a bit, Thanks for the effort!
Title: Re: FingerGestures Actions (Beta)
Post by: Lars Steenhoff on April 12, 2012, 03:20:14 PM
one thing I'm trying to achieve is a pinball flipper action in playmaker, I'm hoping this will help me do it.

For this I divide the screen in two halves left and right.
Then I need to detect if finger is pressed left or right screen.
now activate the according left or right flipper. ( rotate physics object )

The difficult part is that the flipper needs to stay up when a finger is pressed down and only release once the finger is up again.  ( rotate back )

If you can make an example with this kind of behavior that would be very insightful on how this works.

Thanks
Title: Re: FingerGestures Actions (Beta)
Post by: Spk on April 12, 2012, 06:14:35 PM
Thanks for the suggestion Lars. I'm currently doing quite a bit of work revamping the FingerGestures documentation and samples, so it may take a little while until I get to the PlayMaker samples. In the meanwhile, I can do my best to answer your questions though.
Title: Re: FingerGestures Actions (Beta)
Post by: pneill on April 14, 2012, 01:53:10 AM
Got at fair number of errors when I imported the package.

Assets/FingerGestures/Extensions/Playmaker/FingerGesturesDetectInput.cs(177,32): error CS0123: A method or delegate `HutongGames.PlayMaker.Actions.FingerGesturesDetectInput.FingerGestures_OnFingerTap(int, UnityEngine.Vector2)' parameters do not match delegate `FingerGestures.FingerTapEventHandler(int, UnityEngine.Vector2, int)' parameters

Assets/FingerGestures/Extensions/Playmaker/FingerGesturesDetectInput.cs(177,32): error CS0428: Cannot convert method group `FingerGestures_OnFingerTap' to non-delegate type `FingerGestures.FingerTapEventHandler'. Consider using parentheses to invoke the method

Assets/PlayMaker/Actions/FingerGestures/FingerGesturesDetectInput.cs(180,32): error CS0117: `FingerGestures' does not contain a definition for `OnFingerDoubleTap'

Assets/PlayMaker/Actions/FingerGestures/FingerGesturesDetectInput.cs(212,28): error CS0123: A method or delegate `HutongGames.PlayMaker.Actions.FingerGesturesDetectInput.FingerGestures_OnFingerTap(int, UnityEngine.Vector2)' parameters do not match delegate `FingerGestures.FingerTapEventHandler(int, UnityEngine.Vector2, int)' parameters

Assets/PlayMaker/Actions/FingerGestures/FingerGesturesDetectInput.cs(212,28): error CS0428: Cannot convert method group `FingerGestures_OnFingerTap' to non-delegate type `FingerGestures.FingerTapEventHandler'. Consider using parentheses to invoke the method

Assets/PlayMaker/Actions/FingerGestures/FingerGesturesDetectInput.cs(213,28): error CS0117: `FingerGestures' does not contain a definition for `OnFingerDoubleTap'

Any idea what I did wrong?

Title: Re: FingerGestures Actions (Beta)
Post by: Spk on April 14, 2012, 05:50:55 AM
Yeah, you actually need the FingerGestures  (http://fingergestures.fatalfrog.com) package too ;)

Title: Re: FingerGestures Actions (Beta)
Post by: pneill on April 14, 2012, 12:53:43 PM
Yeah, you actually need the FingerGestures  (http://fingergestures.fatalfrog.com) package too ;)

Huh.  That's curious, because I do have finger gestures and it's installed.  Perhaps I need to use a beta?  Or maybe my installation is mucked up?  What version of playmaker and finger gestures did you test with?

(http://www.humblebeard.com/projectView.png)

Title: Re: FingerGestures Actions (Beta)
Post by: Spk on April 14, 2012, 12:57:45 PM
Oops, my apologies! :D
You're probably just running an older version of FingerGestures. You need to be running v2.3b. Which one are you currently using?
Title: Re: FingerGestures Actions (Beta)
Post by: pneill on April 14, 2012, 05:58:46 PM
Yup,that was it.  I was using 2.3 not 2.3b.   

Note, that I do get a warning about the variable 'ray' being assigned but never used.

Title: Re: FingerGestures Actions (Beta)
Post by: pneill on April 15, 2012, 04:00:24 PM
First, this is a really awesome addition.   Accessing touch events in playmaker has never been easier.

Questions/Comments
Is there a way to ignore certain objects?  I have a rather large trigger attached to an object that is in the "Ignore Raycast" layer, but the Finger Gestures Detect Input seems not to have a way to ignore objects in certain layers.  The playmaker "Screen Pick" action has a pretty good way of handling this.

Two caution events are generated

Correcting bad FingerPhase transition (FingerPhase.Ended skipped)
UnityEngine.Debug:LogWarning(Object)
Finger:Update(FingerPhase, Vector2) (at Assets/Plugins/FingerGestures/FingerGestures.cs:886)
FingerGestures:UpdateFingers() (at Assets/Plugins/FingerGestures/FingerGestures.cs:1107)
FingerGestures:Update() (at Assets/Plugins/FingerGestures/FingerGestures.cs:1044)

Assets/FingerGestures/Extensions/Playmaker/FingerGesturesActionHelpers.cs(103,17): warning CS0219: The variable `ray' is assigned but its value is never used
Title: Re: FingerGestures Actions (Beta)
Post by: Spk on April 17, 2012, 11:58:56 AM
Thanks for the feedback pneil!
Adding an option for the object raycast layer should be no problem, good idea! I will add this asap.

As for the double tap vs single tap issue, it's a bit tricky because there is no perfect way to do this from the code without having bad side effects. The reason for this is explained in more detail in this forum thread (http://forum.fatalfrog.com/index.php?topic=20.0).

However, you should be getting BOTH events fired, not just one. In theory, if you do a double tap gesture and have registered for both tap & double tap events,  you should be getting a "tap" event each time the finger tapped the screen, and then a final "double tap" event after two taps occurred. The gestures do not "consume" the input, so they can't prevent one another from receiving input data. Can you double check and confirm you are not getting both events fired please? If not, I might have a bug on my hands :)
Title: Re: FingerGestures Actions (Beta)
Post by: pneill on April 18, 2012, 01:07:00 AM
Awesome news on the raycast layer!  Thanks!!

Regarding the single/double tap.  I think you got a bug here.  I made a very simple scene with just a cube in in it that changes color based upon tap event vs. double tap event - tap event changes cube to one color while double tap changes it to another.    Double tap event never gets called.   I always just get the tap event.
Title: Re: FingerGestures Actions (Beta)
Post by: Spk on April 18, 2012, 04:30:21 PM
Update: version 0.2
- Added Ignore Layer property to FingerGesturesDetectInput action to ignore colliders in specific layers when raycast for objects under the finger
- Removed left-over raycast in FingerGesturesActionHelpers.PickObject()

(Download attachment updated in first post)
Title: Re: FingerGestures Actions (Beta)
Post by: JayToronto on April 18, 2012, 05:39:38 PM
This is great! Finger gestures is awesome.
Title: Re: FingerGestures Actions (Beta)
Post by: Spk on April 18, 2012, 06:16:31 PM
This is great! Finger gestures is awesome.

Now, THAT is what I like to hear :D
Title: Re: FingerGestures Actions (Beta)
Post by: pneill on April 20, 2012, 11:05:04 AM
Any chance you had the opportunity to look at that "tap event" vs. "double tap event" issue I mentioned.  It seems that any gesture input detector that look for either a tap or double tap event never has the double tap event called.
Title: Re: FingerGestures Actions (Beta)
Post by: Spk on April 20, 2012, 11:06:24 AM
No sorry, I haven't had time to look into this yet. It's on the todo list though :)
Title: Re: FingerGestures Actions (Beta)
Post by: YYC on April 23, 2012, 02:31:05 AM
Just tried out the beta package and this is exactly what I am looking for/need. I'll play with the beta version more this week and post further comments on my experience.

Please keep up the development/integration with Playmaker.

Title: Re: FingerGestures Actions (Beta)
Post by: PixelEnvision on April 24, 2012, 02:54:24 PM
Thx for the update.... :)
Title: Re: FingerGestures Actions (Beta)
Post by: pneill on April 24, 2012, 08:44:29 PM
Any chance you had the time to look at that tap event vs. double tap event issue I reported above yet?
Title: Re: FingerGestures Actions (Beta)
Post by: Spk on April 25, 2012, 03:18:25 PM
I've just posted an updated package (v0.3):

- Made the FingerGesturesDetectionInput stateless when it comes to handling continuous gestures such as drag, pinch and rotation.
- Added "Must Hit Object" property to the FingerGesturesDetectionInput action to require a valid object to be present under the finger(s) for events to fire
- Added support for dragging objects via the FingerGestureDragObject action. See "Playmaker Drag" sample scene in the Samples folder.
- Added "Playmaker Tap" sample in the Samples folder
Title: Re: FingerGestures Actions (Beta)
Post by: reedomatic on April 28, 2012, 10:04:50 PM
This finger gestures package is outstanding. The only issue I have come across is that I cannot seem to get the Pinch or Rotation Gestures to fire an event while I'm in the unity editor. When I create an Android build and do the Pinch or Rotation gesture, the event seems to fire like expected. This could be weirdness with Unity remote, but the other events(Swipe, Tap, DoubleTap and Drag) seem to work in both the editor and android build equally fine. BTW, I'm using an Galaxy Tab.
Title: Re: FingerGestures Actions (Beta)
Post by: amaranth on May 02, 2012, 01:59:10 PM
Ran into a little problem. Is there a way to attach Drag Object to the camera? I did this, but the camera won't move. I'm using "Use Owner, None, and ON" settings inside the action. FSM is directly attached to the camera (ortho).
Title: Re: FingerGestures Actions (Beta)
Post by: Spk on May 02, 2012, 02:22:15 PM
Hm im afraid that wont work, as the drag script uses the camera to determine the amount of motion to apply... it'd be like a dog chasing his tail :)

Your best bet is to forgo the DragObject action and use the DetectInput one directly, with the drag move event and output drag delta vector setup, and use that delta value to translate the camera directly.
Title: Re: FingerGestures Actions (Beta)
Post by: amaranth on May 02, 2012, 02:27:59 PM
Cool, will do. Thanks for these awesome scripts! :D
Title: Re: FingerGestures Actions (Beta)
Post by: Amy on May 06, 2012, 04:43:19 AM
Just bought finger gestures ^^ It works along with the GUI correct?
Title: Re: FingerGestures Actions (Beta)
Post by: pneill on May 06, 2012, 01:13:58 PM
Seem to be having some issue with the rotation gesture.  This very well could be a user error, so an updated package with a rotation example would be much appreciated   ;D

FWIW, what I'm seeing is that in the detect input action, if no event is selected, that rotation value variables are not populated.  This makes it challenging to live rotate an object without requiring a state change.

In addition, it seems like only the begin rotation event is fired.  The rotation move and rotation end events don't seem to ever get fired.

Any guidance would be appreciated.  Thanks!
Title: Re: FingerGestures Actions (Beta)
Post by: Spk on May 06, 2012, 02:19:22 PM
Hi neil, i'll take a look at that rotation issue tomorrow and get back to you.
Title: FingerGestures Actions - Swipe Bug
Post by: Jos Yule on May 29, 2012, 11:13:10 AM
Hello.

I'm starting to use the Swipe set of gestures. I wanted to use the velocity param, but was getting a '0' value out of it.

Looking at the code (FingerGesturesDetectInput.cs), and the method FingerGestures_OnFingerSwipe, i can see the velocity being passed into the method, but no setting of the storeSwipeVelocity var. I've simply added:

Code: [Select]
storeSwipeVelocity.Value = velocity;
above the switch statement, and all seems well now.

Peace
jos
Title: Re: FingerGestures Actions (Beta)
Post by: pneill on July 13, 2012, 11:28:07 AM
I got a bug report:

Finger Gestures Get Finger Info is only called OnEnter.  So even if the user selected "every frame" it's only called once.  You should have that every frame boolean check in OnUpdate.

Title: Re: FingerGestures Actions (Beta)
Post by: Spk on August 13, 2012, 08:25:59 AM
Thanks for the bug reports, I'll include fixes in the upcoming 2.4 update (should be out as beta tomorrow).
Title: Re: FingerGestures Actions (Beta)
Post by: Lobohotpants on August 13, 2012, 06:07:48 PM
Is there documentation somewhere on how to use the dragCamera action? 
Title: Re: FingerGestures Actions (Beta)
Post by: S0ULART on November 23, 2012, 08:08:14 PM
Hi
I was trying to check if a finger is already pressed and moves onto another action, so that it starts also how could I achieve this?
I mean like tap on object A and go over with still pressed finger to object B thats beneath object A.
Title: Re: FingerGestures Actions (Beta)
Post by: e1ite on January 17, 2013, 10:58:10 PM
Hi all i'm excited to use Finger Gestures with Unity. I have attached this to a couple game objects and it performs as stated. But my problem now is, I want to be able to pick an object on the screen and store the game object but am having trouble with this. Is there any way to do something like "mouse pick" with this?

Thanks in advance!
Title: Re: FingerGestures Actions (Beta)
Post by: jeanfabre on January 18, 2013, 12:25:37 AM
Hi,

 I made an action just for this few days ago:

http://hutonggames.com/playmakerforum/index.php?topic=2921.0

basically you use this action whenever you want to pick.


bye,

 Jean
Title: Re: FingerGestures Actions (Beta)
Post by: e1ite on January 18, 2013, 12:21:59 PM
Thanks jeanfabre I actually found your script yesterday and was going to try it out the problem is that I can not get a touch event to happen in the screen space, I am only able to get it working on object when a FSM and Finger Gesture event directly on it. My problem is I have a plane with a bunch of child objects with colliers in the scene and I want to be able to touch one of the colliers and get the object that I touched. So if I can get a position on the screen where I touched your raycast script would come in handy.

Thanks,
Jason
Title: Re: FingerGestures Actions (Beta)
Post by: jeanfabre on January 21, 2013, 12:49:05 AM
Hi,

 Would that solve your problem?

http://hutonggames.com/playmakerforum/index.php?topic=2921.0

bye,

 Jean
Title: Re: FingerGestures Actions (Beta)
Post by: luisfdeleon on March 05, 2013, 11:08:09 PM
Quick questions.  Will I be able to have a state that is capable of firting three different transitions depending if the player did a tap, hold or pinch action?  Will Finger Gestures be able to distinguish the three different (and yet, some what similar) actions on the same state, or will I have to make a more elaborated FSM to make that work?
Title: Re: FingerGestures Actions (Beta)
Post by: jeanfabre on March 18, 2013, 03:07:49 AM
Hi,

 yes, states can host several transition, and it's up to the first action in that state to fire what ever transition event. as for fingergesture, what is the gesture you expect to fire in different forms?

bye,

 Jean
Title: Re: FingerGestures Actions (Beta)
Post by: LiveWire on June 05, 2013, 12:15:44 AM
Hi there, I've just started working with Playmaker and FingerGestures. I'm attempting to  send and event on double tap, but I can't find a 'DoubleTap' action or an option for double taps in the  'Tap Event' action. Am I looking in the wrong place or has Double Tap been removed? I see there are a lot of posts earlier in this thread mentioning problems with double tap...
Title: Re: FingerGestures Actions (Beta)
Post by: ddfire on June 17, 2013, 02:29:43 PM
is there any new update?
Title: Re: FingerGestures Actions (Beta)
Post by: gregowich on May 05, 2014, 06:43:50 AM
I'm trying to make a picturebook app for iOS. I recently got FingerGestures hoping it would make it possible to swipe between pages (scenes) but I don't know how, and can't find any tutorials or documentation on that. Is that even possible to swipe between scenes?