"We offer new support options and therefor the forums are now in read-only mode! Please check out our Support Center for more information." - Vuforia Engine Team

How to get ImageTargets programmatically??

I want to enable extended tracking programmatically.

I referred to the post below, but there was no method StartExtendedTracking () in Trackable.

https://developer.vuforia.com/forum/unity-extension-technical-discussion/setting-extended-tracking-runtime

 

And then I tried this code.

foreach (var tb in stateManager.GetTrackableBehaviours())

     {

      ((Vuforia.ImageTarget) tb.Trackable).StartExtendedTracking();

     }

 

but this does also not work

InvalidCastException: Cannot cast from source type to destination type

Could you help me??

 

Unity 2017.3.1

Hello YoshihideNishimoto,

Cast the tb.Trackable to an ObjectTarget instead. You can see an example of this in TrackableSettings.cs in our Core Samples.

Thanks,

Vuforia Support