Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started 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
-
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
-
Thanks Jean
Works perfect! Exactly what I was looking for. :)
-
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.
-
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
-
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?
-
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
-
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.
-
Hi,
I suspect it's because you don't have the "PlayMakerVuforiaTrackableProxy" component on your marker.
bye,
Jean
-
Thank you Jean,
Another question please, How can I detect VirtualButton events?
-
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
-
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
-
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
-
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.
-
The AR video is connected to the VideoPlaybackBehaviour.cs script
-
Hi,
I can't find any VideoPlayBackBehavior.cs
Can you tell me where you got that? I have the latest vuforia package.
bye,
Jean