Log in or register to post comments

Cycle through GameObject Index

March 22, 2019 - 5:24am #1

Hi Guys , i have a programming issue using GameObjects.  I need an ordered array of Targets 1-10.  The Ar camera will pick up a target and show the model for that target which i do fine , But if the sequence is out of sync like the person goes from image 1 to 4 it will show an error model becaise it isnt in order ,  So it must go 1-2-3-4  or 5-6-7-8 so on , .  So if 1 and next = 2 , show model if not  = 2 show error model untill  i find the image labelled 2 in the index.  It sound simple enough but i cant get it to work using Gameobjects as thry wont convert to ints to cycle though lists etc .  Its been weeks now and i cant figure it out.  Any help much appretiatesd. 

Thanks Darryl

Cycle through GameObject Index

March 22, 2019 - 6:52am #2

Hi Darryl, so if I understand correctly you're describing a type of state machine that depends on the ID of a certain image target to advance to the next state or to trigger an error.

You'll have to look at the DefaultTrackableEventHandler which has the OnStatusChanged() callback. Use this to determine if an ImageTarget has been detected/tracked. You'll have to have a class to track the progress of detected images and handle the status changes (advance if correct ImageTarget was detected, show error if not). 

Go here for more info on the event handler: https://docs.unity3d.com/Manual/vuforia_tips.html

 

Log in or register to post comments