Playmaker Forum

PlayMaker Updates & Downloads => Share New Actions => Topic started by: vonchor on November 13, 2011, 11:10:58 AM

Title: Using playMaker and FingerGestures
Post by: vonchor on November 13, 2011, 11:10:58 AM
If you want to use FingerGestures along with playMaker this modded file will do the trick for the Toolbox functions. The Toolbox provides drag, tap, swipe, and other basic functionality. Instructions for use are embedded within the file so read it before trying to do anything.

PLEASE NOTE:

0. This code was released with the permission of William Ravaine, creator of FingerGestures.
1. You need to purchase FingerGestures from the asset store to use this file (well sort of obvious :-)
2. this is unsupported by the creator of FingerGestures and/or by me.
3. Uhh, I don't remember (a USA political joke)
4. There is no number 4 (a Monty Python joke)
5. This is probably a temporary solution as there may be "official" PM<->FG support one day.
Title: Re: Using playMaker and FingerGestures
Post by: jeanfabre on November 14, 2011, 12:17:15 AM
Hi,

 Excellent! Thanks for sharing. Code is interesting, really have to learn how to work with Types.

Bye,

 Jean
Title: Re: Using playMaker and FingerGestures
Post by: MaDDoX on November 17, 2011, 01:16:29 AM
Very nice Vonchor, I'll check it out as soon as I get some.. time.. hmm.. when will that ever happen? :o RageTools development is really chewing up my time like crazy! But I might get an excuse to try this as I build the RageText web demo ;)
Title: Re: Using playMaker and FingerGestures
Post by: Andrew.Lukasik on November 18, 2011, 03:48:54 PM
Thanks a lot!

A.
Title: Re: Using playMaker and FingerGestures
Post by: soofaloofa on November 30, 2011, 12:45:45 PM
I'm having trouble registering for these events in my FSM. Do you have a quick tutorial on how to get started?

Thanks!
Title: Re: Using playMaker and FingerGestures
Post by: vonchor on December 07, 2011, 12:40:47 PM
no, there's no tutorial. You just set the fields in the script using Unity's inspector. Set the GO, FSMName, and FSMEvent. The event has to be a global event (I think). Be sure that the Fsm_mode checkbox is on. There's no "registration" concept at all.
Title: Re: Using playMaker and FingerGestures
Post by: Microike on January 25, 2012, 07:16:25 AM
VERY nice .tks
Title: Re: Using playMaker and FingerGestures
Post by: qholmes on February 07, 2012, 12:06:39 PM
Well i made my own simple touch system but it was just not reliable for some reason.. So here we go. Lets give this a try. Hoping for awesome things..

Thanks for this helper!!!

Q
Title: Re: Using playMaker and FingerGestures
Post by: qholmes on February 07, 2012, 11:34:09 PM
Wouldn't you know that what i want to do is not really straight forward... figures.. Oh well got some help on the main forum. I think it will work out but used work around for now.

I may make a little tutorial for this as i had absolutely no idea how to get this thing working.. Not the PM part but Finger Gestures.. Still not quite clear actually. After my holidays...

Q
Title: Re: Using playMaker and FingerGestures
Post by: Mark_T on February 16, 2012, 05:01:46 PM
Wouldn't you know that what i want to do is not really straight forward... figures.. Oh well got some help on the main forum. I think it will work out but used work around for now.

I may make a little tutorial for this as i had absolutely no idea how to get this thing working.. Not the PM part but Finger Gestures.. Still not quite clear actually. After my holidays...

Q

I didn`t bought FingerGestures yet, but I`ll be really happy for a tutorial to see what is possible with Playmaker. There is also a FingerGestures forum here: http://www.fatalfrog.com/?page_id=474&mingleforumaction=viewtopic&t=2 (http://www.fatalfrog.com/?page_id=474&mingleforumaction=viewtopic&t=2). maybe with some more demanding we might get official support. :)


Title: Re: Using playMaker and FingerGestures
Post by: Mark_T on February 16, 2012, 05:03:25 PM

And vonchor, many thanks for your contribution!

Title: Re: Using playMaker and FingerGestures
Post by: vonchor on February 16, 2012, 07:50:10 PM
You're welcome. Actually at this point I'm using EZGUI and not FingerGestures. Not that there's anything wrong with FingerGestures, I just found that the combo of EZGUI and SpriteManager2 provides functionality I was going to add on top of FingerGestures; and I don't believe in reinventing the wheel so I paid the $ and made the transition.
Title: Re: Using playMaker and FingerGestures
Post by: qholmes on February 20, 2012, 10:46:11 PM
Well holidays are done and back to the grind.... I tried to get Finger Gestures to do what i wanted and no luck so far.. I have a few leads to check up on with the main forum. My issues are with tracking and controlling if i have a touch on an object or a swipe on the screen over top of it or a pinch for zoom.. But still hoping for good things.

I built a pinch with PM but found it was not very consistent in how it updated for some reason.

Q
Title: Re: Using playMaker and FingerGestures
Post by: qholmes on February 26, 2012, 11:42:33 AM
Ok i have FG doing everything that i needed.... totally thanks to Vonchor's mod!! thanks!!!

I modified a bunch of the scripts and they are working great for me.. Nor sure if i am breaking any rules by what i did but it works.. Yeaaaaaa

Q
Title: Re: Using playMaker and FingerGestures
Post by: qholmes on February 26, 2012, 10:30:49 PM
Ok i had this working just fine.. I was working in one Scene and building tests to my iPad.. worked perfect..

Then i did a full build with my main menu scene as well.. Now i get this error.. It seems to be an error when the FG tries to send the event to PM.. Any ideas on this? Why the difference between two scenes and just one? I assume something is not loading properly so it can not get a reference to it.. But i don't know how to fix it.. was supposed to send a full project an hour ago of course but he is running with the one scene instead.


NullReferenceException
  at HutongGames.PlayMaker.Fsm.SendEventToFsmOnGameObject (UnityEngine.GameObject gameObject, System.String fsmName, HutongGames.PlayMaker.FsmEvent fsmEvent) [0x00000] in <filename unknown>:0
  at HutongGames.PlayMaker.Fsm.Event (HutongGames.PlayMaker.FsmEventTarget eventTarget, HutongGames.PlayMaker.FsmEvent fsmEvent) [0x00000] in <filename unknown>:0
  at HutongGames.PlayMaker.Actions.SendEvent.OnEnter () [0x00000] in <filename unknown>:0
  at HutongGames.PlayMaker.FsmState.OnEnter () [0x00000] in <filename unknown>:0
  at HutongGames.PlayMaker.Fsm.EnterState (HutongGames.PlayMaker.FsmState state) [0x00000] in <filename unknown>:0
  at HutongGames.PlayMaker.Fsm.SwitchState (HutongGames.PlayMaker.FsmState toState) [0x00000] in <filename unknown>:0
  at HutongGames.PlayMaker.Fsm.DoTransition (HutongGames.PlayMaker.FsmTransition transition, Boolean isGlobal) [0x00000] in <filename unknown>:0
  at HutongGames.PlayMaker.Fsm.ChangeState (HutongGames.PlayMaker.FsmEvent fsmEvent) [0x00000] in <filename unknown>:0
  at HutongGames.PlayMaker.Fsm.Event (HutongGames.PlayMaker.FsmEvent fsmEvent) [0x00000] in <filename unknown>:0
  at HutongGames.PlayMaker.Fsm.Event (System.String fsmEventName) [0x00000] in <filename unknown>:0
  at TBComponent.Send (.Message msg) [0x00000] in <filename unknown>:0
  at TBFingerDown.RaiseFingerDown (Int32 fingerIndex, Vector2 fingerPos) [0x00000] in <filename unknown>:0
  at TBInputManager.FingerGestures_OnFingerDown (Int32 fingerIndex, Vector2 fingerPos) [0x00000] in <filename unknown>:0
  at (wrapper delegate-invoke) FingerGestures/FingerDownEventHandler:invoke_void__this___int_Vector2 (int,UnityEngine.Vector2)
  at FingerGestures.RaiseOnFingerDown (Int32 fingerIndex, Vector2 fingerPos) [0x00000] in <filename unknown>:0
  at FingerGestures.PerFinger_OnDown (.Finger source) [0x00000] in <filename unknown>:0
  at (wrapper delegate-invoke) FingerGestures/Finger/FingerEventDelegate:invoke_void__this___FingerGestures/Finger (FingerGestures/Finger)
  at FingerGestures+Finger.PostUpdate () [0x00000] in <filename unknown>:0
  at FingerGestures.UpdateFingers () [0x00000] in <filename unknown>:0
  at FingerGestures.Update () [0x00000] in <filename unknown>:0
  at TouchScreenGestures.Update () [0x00000] in <filename unknown>:0
 
(Filename:  Line: -1)
Title: Re: Using playMaker and FingerGestures
Post by: qholmes on February 29, 2012, 10:31:19 AM
I am told it is just a PM bug with Send Event.

Q
Title: Re: Using playMaker and FingerGestures
Post by: Alex Chouls on March 06, 2012, 06:45:40 PM
Hi Q,

Has the 1.3.3 beta fixed the NullReferenceException for you?

Thanks!
Alex
Title: Re: Using playMaker and FingerGestures
Post by: qholmes on March 06, 2012, 06:48:51 PM
Ummm i have not tried it yet.. I was sidetracked to Max movie projects instead. But they end tomorrow.

How do i get the beta's again? I think i have it in an email somewhere.

I will let you know

Q
Title: Re: Using playMaker and FingerGestures
Post by: jeanfabre on March 07, 2012, 02:46:35 AM
Hi,

 This is very likely a problem when you reload the scene at runtime and send an event on a start state. It very much look like this bug ( that is likely fix in the current beta).

 Bye,

 Jean
Title: Re: Using playMaker and FingerGestures
Post by: qholmes on March 07, 2012, 04:11:14 AM
This is good.. my plan is to upgrade to 3.5 this week with all the new assets. Hoping for good things.

Currently up with 12 month old barfing. not super fun. Oh well.

Q
Title: Re: Using playMaker and FingerGestures
Post by: Mark_T on March 20, 2012, 01:29:42 PM
Quote from: Spk;868078
If you are interested in the PlayMaker integration, please leave some comments/suggestions in on the FG forum thread here (http://forum.fatalfrog.com/index.php?topic=12.0). Thanks!

A quote from FingerGestures developer on his Unity forum thread (http://forum.unity3d.com/threads/95983-RELEASED-FingerGestures-Robust-input-gestures-at-your-fingertips!/page28).

Title: Re: Using playMaker and FingerGestures
Post by: qholmes on March 20, 2012, 01:40:02 PM
Thanks i posted.

Q
Title: Re: Using playMaker and FingerGestures
Post by: qholmes on March 28, 2012, 11:21:33 PM
Ok so my issues with FG and PM are gone with the new versions.. And the issues with loading scenes is also gone.. not sure where that post is at the moment... Yea..

Q
Title: Re: Using playMaker and FingerGestures
Post by: qholmes on March 29, 2012, 11:28:16 AM
Can the smart people tell me why i cant use this code inside a PM Action?

Obviously i am not including the public class.. But just trying to insert that basic reference to the TapGesture Recognizer?

I am sure this is a basic scripting thing but i am not a scripter so i dont get it.  ???

Q

using UnityEngine;
 
public class MyTapHandler : MonoBehaviour
{
    // reference to our tap gesture recognizer object
    public TapGestureRecognizer tapRecognizer;
 
    void Start()
    {
        // register to the tap recognizer's OnTap event
        tapRecognizer.OnTap += tapRecognizer_OnTap;
    }
 
    // our tap event handler method
    void tapRecognizer_OnTap( TapGestureRecognizer source )
    {
        Debug.Log( "TAP detected at " + source.Position );
    }
}
Title: Re: Using playMaker and FingerGestures
Post by: qholmes on March 29, 2012, 02:30:26 PM
So i have no idea how to implement the code directly inside a PM action if it is even possible.. But i did manage to make a non TB-- FG script that sends messages to PM just like Vonchor's mod.

It works good i think.. seems to anyway.

Still more hurdles for me but getting there.

Q
Title: Re: Using playMaker and FingerGestures
Post by: Alex Chouls on March 29, 2012, 03:13:59 PM
You can register gesture recognizers in an action... your code actually looks fine. Did you have a Finger Gestures Initializer in your scene?

I think official Finger Gestures actions should be ready very soon!
Title: Re: Using playMaker and FingerGestures
Post by: qholmes on March 29, 2012, 03:17:27 PM
Are you collaborating on something.... this would be awesome.. i am making good headway though.

Q
Title: Re: Using playMaker and FingerGestures
Post by: Mark_T on April 10, 2012, 03:38:51 AM
I just found William Ravaine has posted the first beta version for his FingerGestures actions. You can find more info in the new FingerGestures Actions for Playmaker  (v0.1) (http://forum.fatalfrog.com/index.php?topic=48.0) thread.