Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: acass64 on May 22, 2013, 11:36:29 AM

Title: Detecting functions
Post by: acass64 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
Title: Re: Detecting functions
Post by: jeanfabre 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
Title: Re: Detecting functions
Post by: acass64 on May 23, 2013, 12:09:26 PM
Thanks Jean

Works perfect! Exactly what I was looking for.  :)
Title: Re: Detecting functions
Post by: jrawkus2 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.
Title: Re: Detecting functions
Post by: jeanfabre 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
Title: Re: Detecting functions
Post by: pixeltroll 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?
Title: Re: Detecting functions
Post by: jeanfabre 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
Title: Re: Detecting functions
Post by: xunxun 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.(https://dl.dropboxusercontent.com/u/26860437/Screen%20Shot%202013-07-29%20at%2011.01.48%20PM.png)

But no luck, I didn't get the Debug Log above. Please help.
Title: Re: Detecting functions
Post by: jeanfabre 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
Title: Re: Detecting functions
Post by: xunxun on August 10, 2013, 03:30:28 AM
Thank you Jean,

Another question please, How can I detect VirtualButton events?
Title: Re: Detecting functions
Post by: jeanfabre 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
Title: Re: Detecting functions
Post by: acass64 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
Title: Re: Detecting functions
Post by: jeanfabre 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
Title: Re: Detecting functions
Post by: acass64 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.
Title: Re: Detecting functions
Post by: acass64 on September 18, 2013, 09:30:11 PM
The AR video is connected to the VideoPlaybackBehaviour.cs script
Title: Re: Detecting functions
Post by: jeanfabre on September 26, 2013, 03:59:51 AM
Hi,

 I can't find any VideoPlayBackBehavior.cs

 Can you tell me where you got that? I have the latest vuforia package.

bye,

 Jean