Log in or register to post comments

Virtual Button not working on multiple image targets

March 7, 2013 - 10:14pm #2

Hi,

I am following Virtual button Image target sample and I added my own 3d object instead of teapot and also change the marker on "ImageTargetWood", its working perfectly fine but now i need same replica for 3 more Imagetargets so I copy and past "ImageTargetWood" and change the name and also markers with accordingly need but its working fine for last Image target changing color on tapping virtual button I also added in "Virtualbuttonmnenu" class like following.

 mImageTargetWood = GameObject.Find("ImageTargetWood").GetComponent<ImageTargetBehaviour>();
        
        mImageTargetWoodChris = GameObject.Find("ImageTargetWoodChris").GetComponent<ImageTargetBehaviour>();
        // Add a mesh for each virtual button on the Wood target.
        VirtualButtonBehaviour[] vbs =
                mImageTargetWood.gameObject.GetComponentsInChildren<VirtualButtonBehaviour>();
         foreach (VirtualButtonBehaviour vb in vbs)
        {
            CreateVBMesh(vb);
            // Also store the position and scale for later.
            mVBPositionDict.Add(vb.VirtualButtonName, vb.transform.localPosition);
            mVBScaleDict.Add(vb.VirtualButtonName, vb.transform.localScale);
        }
        
        vbs = mImageTargetWoodChris.gameObject.GetComponentsInChildren<VirtualButtonBehaviour>();
        
        foreach (VirtualButtonBehaviour vb in vbs)
        {
            CreateVBMesh(vb);
            // Also store the position and scale for later.
            mVBPositionDict.Add(vb.VirtualButtonName, vb.transform.localPosition);
            mVBScaleDict.Add(vb.VirtualButtonName, vb.transform.localScale);
        }

 

Just to activate for both of them, right now I am using only two of them for testing but its working fine with "ImageTargetWoodChris" but not the first one "ImageTargetWood", and virtual botton not performing their action on it. If you know please help me on that. Thanks in advance.

Virtual Button not working on multiple image targets

March 11, 2013 - 9:17am #1

Hi,

if I correctly understand, you have multiple instances of Image Targets where you change the name, but they are using the same Dataset (XML) and the same image target in the DataSet (for instance "wood");

if that's the case, the reason why it does not work is because Vuforia currently does not support multiple instances of the same image target (i.e., you will need to use a different image, such as "chips" or "stones" for instance, for each new Image target instance)

 

Log in or register to post comments