Remove canvas on TrackingStateCondition

Hey! I was diving into the documentation but can’t seem to find enough info on how to code the following:

  1. AR session is initialized with a canvas that shows a box to fit an image marker
  2. When the image marker is tracked, remove the box to fit the image marker

I’m guessing it’s fairly simple with something like if(TrackingStateCondition = true), do X, but can’t seem to find how to call that specific thing.

Hey @Ricardotlpz ! This is super quick to do using a ‘Match Action’ on your image marker proxy and doesn’t require writing any code. Set up your UI canvas with the marker instructions, and then on the marker proxy, add a ‘Match Action’, then use the ‘Add Event’ button in that component to add a ‘On Match Acquire’ event, connect your canvas, and set the dropdown to GameObject.SetActive, with the checkbox to ‘false’. So your proxy will look something like this:


Full editor context:

You’ll see that I’ve also added a simulated image marker into my simulation scene, so I can test this locally. You can do that using the MARS Panel (Window > MARS > MARS Panel), and pick ‘Synthetic Image Marker’ there, and make sure to set that marker and your marker condition up to use the same image.

I attached a package containing the scene+asset I put together for the screenshots.

Does that do what you’re looking for?

7328329–890050–marker-canvas-example.unitypackage (8.71 KB)

YES! This was exactly what I was looking for! Thank you so much.

Awesome, you’re welcome, keep it coming!