Hi,
I have enabled extended tracking and almost always it works just fine, but sometimes happens that my object disapears. I want to prevent it, at least with some kind of notification (“You lost target, you need to find it again.”). The question is, how to check if object actually disappears.
Answer for myself
protected TrackableBehaviour mTrackableBehaviour;
void Awake ()
{
mTrackableBehaviour = GetComponent<TrackableBehaviour>();
}
Remember that this class has to be in the same object as DefaultTrackableEventHandler.cs is, inherit from ITrackableEventHandler, and about
using Vuforia;
After that you can check STATES of your tracking. All states you find here:
https://library.vuforia.com/content/vuforia-library/en/reference/unity/classVuforia_1_1TrackableBehaviour.html#a67a0db04d321a74b7e7fcfd3f1a3f70baf8c96098a30de26eecad683692f70169
For example:
if (mTrackableBehaviour.CurrentStatus ==TrackableBehaviour.Status.NO_POSE )
{
ShowAlert();
}