"We offer new support options and therefor the forums are now in read-only mode! Please check out our Support Center for more information." - Vuforia Engine Team

Preventing VuMark Child Cloning

I am currently testing some things with VuMarks in Unity, part of which includes moving an object from one VuMark to another when a new one is tracked. The issue I am currently running into is that when the new VuMark is detected, the current VuMark is cloned to represent it, including the child object. So instead of having one object moving between two VuMarks, I have two objects, one on each mark.

If I'm understanding correctly, the object must be childed to the VuMark in order to appear. When a new VuMark is tracked, it is represented by cloning the hierarchy of the VuMark in my scene, which contains the object, resulting in it also being cloned. Is there a way to prevent the children of a VuMark from being cloned when a new mark is tracked, or a way for my object to be visible without being a child of the VuMark?

I am using Unity 2017.3.1f1, and the VuMarks are two instances of the same template.

Hello MattW2013,

There is no way to prevent this behaviour as that is how Vuforia handles detecting multiple instances of a VuMark.

If I wanted the item to track along with the VuMark however, am I correct in assuming my only two options are to child it to the mark, or update it to the mark's position each frame?

This is correct. Though to avoid the issue initially described in this post I'd recommend parenting the object to the VuMark at runtime. This will give you exact control over what you are doing with the augmentation and will prevent more objects from spawning when you detect more targets.

I am currently parenting the object to the mark at runtime, but since it is in the mark's hierarchy when the new mark is detected, it is being clones into the new mark. I believe the only solution would be to track the mark every frame, please correct me if I'm wrong.

I too found this problem while trying to spawn several instances of a VuMark.

You do not have to track this every frame, but only when the VuMark identifies a mark. After trying different solutions to this problem, I found a suitable one for my project: