"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

RegisterTrackableEventHandler outdated

Hi there.

My goal is to create a marker content dynamically from an assigned prefab when a marker is tracked. So I found a guide (see below) which seems to work for the most parts. However, the method  'RegisterTrackableEventHandler'  from the interface  'ITrackableEventHandler'  are outdated and do not work as they should anymore.

There is a suggested solution for the method which is using the new method  'RegisterOnTrackableStatusChanged'  instead.

But the problem here is that there methods are using different kind of parameters: the old one passes 'this' (the script with the implemented interface 'ITrackableEventHandler' while the new one wants an Action<TrackableBehaviour.StatusChangeResult> as passed parameter, which seems to not exist yet.

 

Is there a clean and simple method to successfully make use of the old function of a newly tracked target without having to create a whole new action?

I am using the latest version of Vuforia (v8.6.7) with Unity 2019.2.

 

Thanks in advance!

 

This is the guide:

https://library.vuforia.com/articles/Solution/Working-with-Vuforia-and-Unity.html#dynamically-add

I was using the below code with no problems, but the latest update to Android 11 had problems with placement in MidAir, so I was troubleshooting by updating Vuforia from 9.8.8 to 10.1.4.  Now I'm getting compiler errors:

Hey,

 

If you could share the code that is creating the errors, I could check what new API calls you should use for this.

Thanks! 

 

Kind regards,

Patrick Scheper

Technical Community Manager

brownekm

Tue, 09/21/2021 - 12:36

In reply to by pscheper

I'm using exactly what Revvy shared below.  I've put in bold the lines that now error with Vuforia 10.1.4:

using UnityEngine;

using Vuforia;

using System.Collections;