Hi,
I want to create an AR-App with two Image targets and one object. When the camera recognizes Target A or B the object should appear with all the features I added (a button and when you hit the button you see what's inside the object). It is very simple.
When the camera recognizes target A the object appears and the features I added. Everything works. So far so good.
Now I want that as well for target B. If I just copy the ImageTarget and change in "Image Target Behaviour (Script)" the Image Target to B the object appears and the button as well. Now when i hit the Button the script is executing but nothing is happening with the object. With Target A everything still works.
A little Summary if it was too complicated:
If the camera is tracking Image Target A or B the same Object should appear. So two possible targets and it should work with both but I is only working with one...
Can you please help?
Cheers
You could:
Make a prefab of you object and parent to both your image targets.
or
Have your object a child of one and then reparent it to the other if it's detected. Look at DefaultTrackableEventHandler script. In the method OnTrackableStateChanged. You can check the current trackable name and handle from there.