Log in or register to post comments

How to get ImageTargets programmatically??

May 13, 2018 - 8:38pm #1

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

How to get ImageTargets programmatically??

May 14, 2018 - 4:49pm #2

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

Log in or register to post comments