I want to know if there is a way to use a script to control which model target to detect when using Vuforia. For example, I have a database and it is currently detecting Model A. Can I use a script to make it detect Model B instead?
I have tried using VuforiaBehaviour.Instance.ObserverFactory.CreateModelTarget but it did not successfully create the target.
Thank you for your help.
The easiest is probably just to deactivate the GameObject of the Model Target.
So, in a method, add
modelTarget_A.enabled = false;
modelTarget_B.enabled = true;
CreateModelTarget() shouldn't be used as this just creates the Model Target Behaviour at runtime. If you have the Model Target GameObjects in the scene, then they are created at initialization and active by default.
Hope it helps,