Log in or register to post comments

Remove Object when Tracker is no longer visible?

April 7, 2019 - 1:14pm #1

Hey,

 

I want to remove an object when the tracker is no longer visible. So far I understood that the object will still be visible when "Extended Tracking" is enabled, although I need this for certain other objects (e.g. videos). Can I disable this only for certain trackers? So far I understood that it's only is available globally...

 

Thanks in advance for any help!

Remove Object when Tracker is no longer visible?

April 11, 2019 - 9:21am #4

Hello,

I suggest that you review the DefaultTrackableEventHandler.cs script in the Vuforia Engine Core samples. This provides an example for how to poll for tracking status changes, and actions to be taken when tracking is lost and/or found.

Note that sometimes additional steps may need to be taken depending upon your target type, so there are additional tracking event handlers that inherit from this class. Again, all contained within our sample code.

HTH.

Thanks,

Vuforia Engine Support

Remove Object when Tracker is no longer visible?

April 8, 2019 - 1:41pm #3

Thanks for the input, but I'm not sure if I got that quite right.

 

I added the following function to protected virtual void OnTrackingLost():

 

Destroy(objectx.gameObject);

 

But it still won't be removed when tracking is lost. Do I have to do anything else?

Remove Object when Tracker is no longer visible?

April 8, 2019 - 10:36am #2

Hello,

Despite Extended Tracking being enabled globally, you can still poll the state of each trackable: https://library.vuforia.com/content/vuforia-library/en/articles/Solution/tracking-state.html

In your case, if a target's state is "TRACKED" you'd display content as it means the target is being actively tracked based upon visual features.

Thanks,

Vuforia Engine Support

Log in or register to post comments