"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

Locking multiple AR overlay images on the screen

Hi all, I'm developing iOS AR apps with Unity and I'm trying to lock the overlay image onto the screen when clicking on a GUI button I created. I managed to achieve this with one image target (please see TackableEventHandler script attached), but when I try to include multiple image targets in the app, I can only lock the first image target in the hierarchy (the most recent image target created in Unity). This is what I'm referring to by locking the screen: initially when the image is being tracked and rendering is enabled, I can move my phone away from the image and the overlay disappears. Next, when the image is being tracked and the lock button is clicked, I need the overlay image to freeze on the screen, regardless of where the phone is pointed to. In the code I've disabled rendering and the image no longer tracks when the lock button is clicked. Finally, if the lock button is clicked again, the locked overlay image disappears and rendering is once again enabled. A similar feature can be found in Blippar's AR app (can be downloaded from the iphone app store). As I mentioned, my issue arises when trying to include multiple image targets in an app. Only the image target highest in the hierarchy does what I stated above, and the rest of the image targets don't lock when the lock button is clicked (rendering continues to be enabled). Has anyone had experience with this and might know how I can overcome this? Input would be much appreciated. Thanks.

DavidBeard

Sat, 03/03/2012 - 01:35

I think that it's because you're drawing the buttons on top of each other, by using OnGUI in each instance of the trackable event handler. So only the top button is clickable. For example, if you only present buttons for unlocked trackables, you'll be able to lock them all in series.