playMaker

Author Topic: Vuforia & Playmaker Setup/Use  (Read 2589 times)

gregacuna

  • Full Member
  • ***
  • Posts: 142
Vuforia & Playmaker Setup/Use
« on: August 30, 2018, 04:55:24 PM »
Hey All...Jean and I have been exchanging private messages which could be helpful as a public discussion about the basics of setting up and using Vuforia with Playmaker. I've faced several challenges and thought I'd share some of what I've gone through along with some info I've gotten from Jean's responses.

My initial problem was Vuforia and Playmaker were installing fine in Unity 2017 (but there was a problem with my project importing), but when installing Vuforia in Unity 2018 there was an error message due to one of the actions being deprecated. That was solved when Jean told me:

Add PLAYMAKER_VUFORIA_7_2_20_OR_NEWER to Scripting Define symbols field in the Player Settings.

That allowed me to use Vuforia in Unity 2018 along with Playmaker, but it really confused me about how Playmaker could control Vuforia because in 2017 the deprecated Playmaker action seemed to have a lot of things it could do, but I can't find any of that in 2018.

Jean's response to this was:

The removed component is obsolete, now everything can be setup within Vuforia using their own components, no need for API access to control position of objects when the original target position is lost (called extended tracking).

I'm going to check on this today, but I must admit I'm still quite confused. I can't even figure out how to use the simple Playmaker Vuforia Trackable Proxy component. I'm getting a "Not Implemented on Target" message even though the component is on ImageTarget.

I guess I wish there were a little more detailed instructions about all this than the few sentences on the Playmaker Vuforia page on the Hutong website.

Does anyone else have any input...and/or questions. I'm super excited about AR and the first game test is super cool, but not sure if a non-programmer like me will be able to do it.

Thanks for any suggestions or help!


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Vuforia & Playmaker Setup/Use
« Reply #1 on: August 31, 2018, 02:34:47 AM »
Hi,

 thanks for bringing this topic on a thread here :)

 basically, I think you haven't setup your database properly, you need to go on Vuforia dashbord, create an app, add the images you want to track, produce a package that vuforia will create, then you import it, and finally you'll be able to use this.

 Can you confirm you have done this, and have check the Unity/vuforia docs on this?

 Bye,

 Jean

gregacuna

  • Full Member
  • ***
  • Posts: 142
Re: Vuforia & Playmaker Setup/Use
« Reply #2 on: August 31, 2018, 11:17:31 AM »
Hey Jean,

My database is fine and the basics of Vuforia work. I'm still learning, but I'm guessing I've been thinking about it in the wrong way. Have been trying to have objects NOT childed to the ImageTarget to be persistent (ie consistently relative to the camera), but it seems like may have to have all objects childed to the ImageTarget and then force them to move relative to each other.

Any thoughts on that?

Doing more tests today and will report back soon.

gregacuna

  • Full Member
  • ***
  • Posts: 142
Re: Vuforia & Playmaker Setup/Use
« Reply #3 on: August 31, 2018, 11:25:29 AM »
KEY CHALLENGE:

I want to be able to notify the player (audio and visual cues) when Tracking is LOST.

In Unity 2017 there was the "Vuforia Get Extended Tracking" action which connected with the Play Maker Vuforia Trackable Proxy component.

In Unity 2018 the action is gone how do I use Playmaker to connect to the component (which is still there) to find out if Tracking is lost or found?

gregacuna

  • Full Member
  • ***
  • Posts: 142
Re: Vuforia & Playmaker Setup/Use
« Reply #4 on: August 31, 2018, 03:03:11 PM »
CHALLENGE ANSWER:

I think I figured it out capturing the lost and found state using the action "Vuforia Set Persist Extended Tracking." Name is a little confusing so hopefully this helps others.

Still struggling with how to independently move objects which are all attached to the tracking object.

Am I correct that the AR camera is only going to see objects which are children of a tracking object? Any suggestions for how to make something appear stationary which is a child of the tracking object?

ONE MORE THING: What's the trick to put UI elements in an AR scene?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Vuforia & Playmaker Setup/Use
« Reply #5 on: September 03, 2018, 01:39:32 AM »
Hi,

The AR camera sees everything it's camera settings allow it to see ( its culling mask property), so check that to be sure what can be shown.

how do you want to move objects that are being attached to tracking object? if you want to move them with the user Inputs, it should be straight forward, if you want to use them with some advanced touch to drag them around and such, then it's going to be more involving as you need to move them in reference to their tracking object, not the world. once dirty way is to unparent the object, move it around and when the move is done, parent it back to the tracker.

One other solution is to have an fsm that on lateupdate simply adjust the position of childs, so they are not parented, but simply enforced to look like it. then you can decide when they should follow or not, but a regular parenting switch should also do the job fine.

Bye,

 Jean

gregacuna

  • Full Member
  • ***
  • Posts: 142
Re: Vuforia & Playmaker Setup/Use
« Reply #6 on: September 03, 2018, 02:41:29 AM »
In the game I'm working on now one player is looking at the screen of the phone and the second player is facing the forward camera with the marker card in their hand and moving the player with the card for the other player to see.

That part works no problem.

The two problems are:

1) Want to have a field which is stationary in the middle of the view.
2) Want to have an object (say a ball) which moves randomly around the field that the player is trying to catch.

Have tried several ideas to keep the field stationary by setting position/rotation opposite to the target movement, but it's way too shaky. Have also tried the idea of having a "ground plane" but both my android phones generate an error saying they can't work with ground planes.

For the moving object just not sure how to do it right.

Thanks again for all the help!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Vuforia & Playmaker Setup/Use
« Reply #7 on: September 03, 2018, 02:58:31 AM »
Hi,

To do this, you need to change your camera vuforia behaviour to have the target as the world center.



then your tracker will be static at the world center. then you can have physics on it just fine and also as a result put more objects disposed around the world center just fine.


Bye,

 Jean

gregacuna

  • Full Member
  • ***
  • Posts: 142
Re: Vuforia & Playmaker Setup/Use
« Reply #8 on: September 08, 2018, 05:58:06 AM »
Thanks again Jean...

I've been traveling from the US to India and just getting back to work. Will check it and report back as soon as a I can. Have a great day!