Log in or register to post comments

Vumark Unity object

June 18, 2017 - 8:48am #1

Hello,

 

I am building a Vumark based Unity app. I need to get the Vumark Unity object when it is detected on camera. I know that I can get it in the Update() function of any MonoBehaviour. In the sample Unity Vuforia Vumark scene this part of code creates a callback for when a Vumark is detected. 

 

mVuMarkManager = TrackerManager.Instance.GetStateManager().GetVuMarkManager();

mVuMarkManager.RegisterVuMarkDetectedCallback(OnVuMarkDetected);

public void OnVuMarkDetected(VuMarkTarget target)

{

        Debug.Log("New VuMark: " + GetVuMarkString(target))

}

I would like to get the object in this "OnVuMarkDetected" method so that I don't have to keep checking for it in the Update() method. But I don't see how.

 

Can anyone help?

 

When you have a "VuMarkTarget" instance, is it possible to get its "VumarkAbstractBehaviour"?

 

I tried calling "mVuMarkManager.GetActiveBehaviours()" in the method "OnVuMarkDetected", but it returns an empty Enumerable. But as I said , it works in the Update() method of any Unity object, however it doesn't work in "OnVuMarkDetected". Why is that?

Vumark Unity object

August 8, 2017 - 9:01pm #4

Hi tanton18,

Have you figured out how to get the reference of the Vumark object? I run into the same situation now. 

Thanks

tanton18 wrote:

My use-case is different. Let's say I'm showing text over a certain Vumark. But the text is really data from a server. And that data changes over time which needs to be updated on the Vumark as long as it is visible on screen. That would require me to have a reference to the game object.

Vumark Unity object

June 22, 2017 - 3:30pm #3

My use-case is different. Let's say I'm showing text over a certain Vumark. But the text is really data from a server. And that data changes over time which needs to be updated on the Vumark as long as it is visible on screen. That would require me to have a reference to the game object.

Vumark Unity object

June 19, 2017 - 9:33am #2

Hello tanton18,

Could you provide more context as to what you are trying to do by storing off a reference to the Vumark? The general use case in Vuforia is to perform an action when one of the target types is detected so storing off the reference shouldn't be necessary as you'll have it when you have detected it.

Thanks.

Log in or register to post comments