Log in or register to post comments

How to run a function inside Vuforia's DefaultTrackableEventHandler.cs

September 21, 2019 - 8:44am #1

I'm trying to run a function inside DefaultTrackableEventHandler.cs after Vuforia detects the target by using the protected virtual void OnTrackingFound() but Vuforia can't detect the namespace that I'm using which is saved inside the Assets folder plus whenever I restart Visual Studio, every code that I've added to the DefaultTrackableEventHandler is deleted and the file is reset back to its original state. I think the problem might lie in the fact that DefaultTrackableEventHandler.cs is located inside the Packages folder while the script that I'm using for the namespace is inside the Assets folder.

How do I resolve this issue?

How to run a function inside Vuforia's DefaultTrackableEventHandler.cs

September 23, 2019 - 2:16am #2

Hi,

As far as I understand from your post, you add a function in the DefaultTrackableEventHandler that uses OnTrackingFound(). I believe a solution would be to copy the script in your asset folder, rename it and add your function to it. (of course don't forget to attach it to the GameObject :) )

Furthermore, files from the packages folder should not be modified.

Thank you.

Vuforia Engine Support

 

Edit: Do not rename it, will result in some errors.

Log in or register to post comments