1
votes

I am developing AR application with Unity3d and Vuforia. I want to keep ImageTarget object that tracked found when It was lost. How to keep tracked Image Target model object after tracking lost?

1
I'm not sure what you mean. Do you mean when you lose sight of the ImageTarget, you want the object to stay rather than disappear?bpgeck
@bpgeck, Yes. I mean that. 1. Image Target tracking found and show object. 2. ImageTarget found was lost, but I want to keep it object. I mean. I want to keep showing object and change it's position.Sopheak
I just posted an answer. Does that answer your question?bpgeck
You can enable Extanded Tracking. This post explains it in more detail: developer.vuforia.com/forum/creating-ar-trackables/…J0ANMM

1 Answers

2
votes

The script that handles what happens when tracking is lost is called DefaultTrackableEventHandler.cs and is found in Assets > Vuforia > Scripts. In that file you will find a function OnTrackingLost() This function disables all the renderComponents and colliderComponents for each of the children of the ImageTarget. If you want your object to stay visible comment out the following foreach loops like so:

private void OnTrackingLost()
{
    Renderer[] rendererComponents = GetComponentsInChildren<Renderer>(true);
    Collider[] colliderComponents = GetComponentsInChildren<Collider>(true);

    /*
    // Disable rendering:
    foreach (Renderer component in rendererComponents)
    {
        component.enabled = false;
    }

    // Disable colliders:
    foreach (Collider component in colliderComponents)
    {
        component.enabled = false;
    }
    */

    Debug.Log("Trackable " + mTrackableBehaviour.TrackableName + " lost");
}