I have using Model Target with much success, however, i would like to interact with the model produced after it recognizes the target.
Objective: the model should be invisible on start, but upon touching once, the model appears along with an image.
this works perfectly fine when i did it with an empty scene with a cube and random image. But somehow didnt work with Vuforia.
Can someone shed some light?
public class TouchPlay : MonoBehaviour
public Image Image;
var rend = gameObject.GetComponentInChildren<Renderer>(false);
rend.enabled = !rend.enabled;
Image.enabled = false;
// Update is called once per frame
if(Input.touchCount > 0 && Input.touches.phase == TouchPhase.Began)
Ray ray = Camera.main.ScreenPointToRay(Input.touches.position);
if(Physics.Raycast(ray, out hit))
if(hit.collider != null)
var rend = gameObject.GetComponentInChildren<Renderer>(true);
rend.enabled = Image.enabled = !rend.enabled;