Seen/Notseen with Target Images


#1

Hello, I have a zapcode that I’ve attached to a target image. I followed the tutorial on how to launch the seen/notseen views. My question is, is there a way for the notseen view to come up when the code is first scanned without the target image. This particular project won’t always have the tracking image at the beginning.


Disable Grab-and-Go on Studio
#2

Hi Molly,

If you set your notseen state to be the default state within the controller then it should be the state that is active when the code is first scanned, before the target is seen.

Cheers,
Mark


#3

That was my thought too but when I tried it, it didn’t work that way.


#4

Interesting,

Feel free to send over your zpp project for us to take a look at if this is still an issue.

Mark


#5

Did you have a solution for this?


#6

What Mark posted should have worked. They must have had other code running.
Are you having the same problem?

Steve


#7

Yes i have…
The “Look for Graphic” only starts when the tracking image has been scanned.

Structure
Root > AR-tracking image > script
Root > symbol(Look for Graphic)

**Script:**

        parent.on("seen", () => {
    	// Runs when seen occurs on the parent node
    	//Getting reference to the look for sub symbol
    	const Look_For = symbol.nodes.Look_ForGraphic;

	parent.on("seen", () => {
		//stop look for when target image is in view
		Look_For.nodes.code.stop();
	});

	parent.on("notseen", () => {
		//play look for when target image isn't in view
		Look_For.nodes.code.play();
	});
	
});

#8

Got it working:
Moved the script under the root.

var trackingimage = symbol.nodes.AR_trackingimage;

parent.on("ready", () => {
	// Runs when ready occurs on the parent node
	//Getting reference to the look for sub symbol
	const Look_For = symbol.nodes.Look_ForGraphic;


	parent.on("ready", () => {
		//play look for when root is loaded
		Look_For.nodes.code.play();
	});

	trackingimage.on("seen", () => {
		//stop look for when target image is in view
		Look_For.nodes.code.stop();
	});

	trackingimage.on("notseen", () => {
		//play look for when target image isn't in view
		Look_For.nodes.code.play();
	});
	
});