playMaker

Author Topic: Detecting functions  (Read 7182 times)

acass64

  • Playmaker Newbie
  • *
  • Posts: 7
Detecting functions
« on: May 22, 2013, 11:36:29 AM »
Is there a way for Playmaker to detect when a function from a Unity script is fired.

I am working on an AR project with Qualcomm's Vuforia. I want to trigger a FSM event anytime the OnTrackingFound() or OnTrackingLost() event is fired.

Thanks
« Last Edit: May 22, 2013, 03:50:41 PM by acass64 »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Detecting functions
« Reply #1 on: May 23, 2013, 07:57:12 AM »
Hi,

Ok, for this, you need a proxy component that will catch these QCAR calls and fire PlayMaker Events

And that's a good starting point for me to suppor Vuforia :)

https://hutonggames.fogbugz.com/default.asp?W1119

so, it works like Photon proxy basically, you need to drop the "PlayMakerVuforiaProxy" in your scene, and add the "PlayMakerVuforiyTrackableProxy" to the imageTarget objects you want to get "VUFORIA / TRACKING FOUND" and "VUFORIA / TRACKING LOST" global events.

 If you have other needs, let me know. I checked for loading and activating dataset, but it seems to only work as an editing feature, it might be possible to change that at runtime, but haven't come across a scripted example, so I don't know how to force refreshing...

bye,

 Jean

acass64

  • Playmaker Newbie
  • *
  • Posts: 7
Re: Detecting functions
« Reply #2 on: May 23, 2013, 12:09:26 PM »
Thanks Jean

Works perfect! Exactly what I was looking for.  :)

jrawkus2

  • Playmaker Newbie
  • *
  • Posts: 3
Re: Detecting functions
« Reply #3 on: June 12, 2013, 11:36:31 AM »
Its worth noting that the events Vuforia / Enabled or Disabled are sen to the ImageTarget Game Object, had me scratching my head for a couple of minutes until i checked the script/debug log.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Detecting functions
« Reply #4 on: June 14, 2013, 02:03:14 AM »
Hi,

 yes, thanks for making a note of this. I have mentionned it in the wiki page:

https://hutonggames.fogbugz.com/default.asp?W1119

 but Made it bold to catch the eye.

bye,

 Jean

pixeltroll

  • Playmaker Newbie
  • *
  • Posts: 19
    • Augenpulver stuff
Re: Detecting functions
« Reply #5 on: June 29, 2013, 12:40:02 PM »
Ive tryed the Vuforia Proxy but it doesn't work for me.
What I tryed to do:
Load the Vuforia Playmaker Proxy into the scene.
put it as a child into the hirarchi of the Imagetarget.
added some script and the vuforia global action tracing lost and found.
play the scene in unity with user definable markers.
> AR works fine, but the events does nothing.
I tryed also to make the proxi a child of the 3D object target. > same problem.
what could be the problem?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Detecting functions
« Reply #6 on: July 01, 2013, 02:18:57 AM »
Hi,

 only put the prox at the root of your hierarachy, no need to add it to any childs.

Also, do you have a fsm on the target GameObject? and does it implement "VUFORIA / TRACKING FOUND" and "VUFORIA / TRACKING LOST" global events?

 I'll see about provided a working sample on the wiki this week.

Bye,

 Jean

xunxun

  • Junior Playmaker
  • **
  • Posts: 53
Re: Detecting functions
« Reply #7 on: July 29, 2013, 12:06:18 PM »
I have problem with PlayMaker and Vuforia as well.

I did follow exactly these steps below:

1. Import Playmaker 1.62, Vuforia 2.5 and setup a basic scene with the image Target and the 3D object (Teapot). This step works well

2. Drop prefab "PlayMaker Vuforia Proxy" to Hiarachy.

3. Drop "PlayMakerVuforiaProxy" script into the Teapot (child of ImageTarget)

4. I tried to add FSM into the Teapot. Pls, see the attached image.

But no luck, I didn't get the Debug Log above. Please help.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Detecting functions
« Reply #8 on: July 30, 2013, 06:08:12 AM »
Hi,

 I suspect it's because you don't have the "PlayMakerVuforiaTrackableProxy" component on your marker.

bye,

 Jean

xunxun

  • Junior Playmaker
  • **
  • Posts: 53
Re: Detecting functions
« Reply #9 on: August 10, 2013, 03:30:28 AM »
Thank you Jean,

Another question please, How can I detect VirtualButton events?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Detecting functions
« Reply #10 on: August 12, 2013, 05:07:37 AM »
Hi,

 I would need to work on this. I haven't tackled this aspect yet.

I have to do some work on vuforia this week anyway, will see if I have time to include that. Bump me next week if you haven't heard back from me.

 bye,

Jean

acass64

  • Playmaker Newbie
  • *
  • Posts: 7
Re: Detecting functions
« Reply #11 on: September 17, 2013, 10:05:04 PM »
Hey Jean

Is there anyway, you could add the ability to detect when an AR video is finished playing? (on-complete) and also detect the specific track-able name?

Thanks
Acass

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Detecting functions
« Reply #12 on: September 18, 2013, 02:31:11 AM »
Hi,

 Can you be more specific. I am afraid I don't understand what you mean by AR video.

 Also, the trackable object, has two events, traking found and tracking lost. you implement that on each targets, so when you receive such event you are on the very trackable gameObject set up for vuforia.

Unless I misunderstand your question?

bye,

 Jean

acass64

  • Playmaker Newbie
  • *
  • Posts: 7
Re: Detecting functions
« Reply #13 on: September 18, 2013, 04:59:03 PM »
Sorry Jean

I have a video playing on top of a target image. I want to trigger a Playmaker event when the video finishes playing.

acass64

  • Playmaker Newbie
  • *
  • Posts: 7
Re: Detecting functions
« Reply #14 on: September 18, 2013, 09:30:11 PM »
The AR video is connected to the VideoPlaybackBehaviour.cs script