How can I keep objects invisible when vuforia ImageTarget is lost and found again?

I have several objects inside an ImageTarget. When I click on one of this objects the others dissapear (I disable the mesh renderer component of these objects).

My problem is that if the target is lost and refound, all objects come visible again.

How can I keep these objects invisible even if target is lost?

I believe you can do this by editing the Vuforia script, “DefaultTrackableEventHandler” that is attached to you Image Target. See this method on line 84 (under region “PROTECTED METHODS”).

I would add a case for if an object is clicked, like a bool isClicked.

(This code was not tested!) ( Also I apologize for the odd formatting, this is my first time posting an answer.)

 // add private bool isClicked;

protected virtual void OnTrackingFound()
{
    var rendererComponents = GetComponentsInChildren<Renderer>(true);
    var colliderComponents = GetComponentsInChildren<Collider>(true);
   var canvasComponents = GetComponentsInChildren<Canvas>(true);

       if (isClicked == false)
       {
             //Vuforia's code:
              
             // Enable rendering:
              foreach (var component in rendererComponents)
              component.enabled = true;

             // Enable colliders:
            foreach (var component in colliderComponents)
            component.enabled = true;

          // Enable canvas':
           foreach (var component in canvasComponents)
            component.enabled = true;
      }
    else if(isClicked == true)
     {
        
           
              foreach (var component in rendererComponents)
              component.enabled = false;

             
            foreach (var component in colliderComponents)
            component.enabled = false;

          
           foreach (var component in canvasComponents)
            component.enabled = false;

      }
}

I hope this helps, or at least steers you in the right direction! (: