Closed pinnakkkk closed 1 year ago
Check this script. In OnTrackedImagesChanged() method you will get the event-like status of the currently tracked image on the base of that you can create logic.
Let me know if you still have doubts I'll find the video and share it with you,
I have to point out @pinnakkkk that you cannot rely on the events coming out of ARCore / ARKit. Of note, you can see in line 82 of the above script:
This checks if the item is NOT tracked or Tracked, although ARKit in particular will only mark an item as tracked in the first frame (detection) and marks it as "limited" in subsequent frames. But once it is tracked, it rarely goes back to not tracked. Android on the other hand will mark an item as tracked when detected and never uses "limited". Behaviour can also differ based on the device.
Just something you have to play with and work around
Hi @pinnakkkk,
Are you still having issues? When checking the tracking status of an image, you should both check updated images for trackingState == TrackingState.Limited as well as check whether the tracked image was removed. Let us know if you have further questions.
Hi @pinnakkkk,
Are you still having issues? When checking the tracking status of an image, you should both check updated images for trackingState == TrackingState.Limited as well as check whether the tracked image was removed. Let us know if you have further questions.
Hello @andyb-unity ! Thankyou for replying, setting trackingState to limited works, however it doesn't really work if the you change the image like a slideshow the new image gets added & tracked but old image's prefab still exists unless u cause a massive disturbance between the camera & the image (like putting a hand in between), which removes both the image's prefab.
In our experience yes that's correct. Neither ARCore nor ARKit handle image tracking well under digital slideshow conditions as you describe. (AR Foundation simply reports the tracking status of the underlying platform. It does not implement tracking itself.)
In our experience yes that's correct. Neither ARCore nor ARKit handle image tracking well under digital slideshow conditions as you describe. (AR Foundation simply reports the tracking status of the underlying platform. It does not implement tracking itself.)
That was pretty helpful!
so I have a script that works fine for detection part, but sometimes the last tracked images doesn't change to SetActive(false), even though I'm making sure that they get disabled even when the trackingstate is set to limited. I tried the AR Foundations Demo too same issue old prefabs don't get disabled. it seems like that AR Core assumes both markers are still being tracked hence when checking for trackedImage.referenceImage.name I get both names hence my logic