Trigger on entire object visible

Hello, helpful Zapworks mates.

I was wondering if there is any way to trigger an event when an entire object is visible in the camera view.

I have in mind a box that must fill the entire screen before the project will run. This would force the user to step back the appropriate distance before starting the experience.

Thanks!

1 Like

Hey Donna,

I’m not an official Zappar staff member, but I can tell you about my experience.

I have mostly used smaller tracking images, perhaps the size of a coaster. I’ve found that the zappar platform can recognise images like this optimally from about 2 feet away and closer. It is best to play with your own tracking images, and follow the documentation provided for making them to best of your ability to get the best experience.

I haven’t tried with very large tracking images, say, like the size of a foot by a foot or larger. I imagine they would work well for situations where you want people to step back. But truly, I haven’t tried this yet.

Hope this helps until you can get an official answer :slight_smile:

1 Like

Thank you. I appreciate the answer. However this doesn’t really fit the bill. I was looking for something that would detect when an entire object was visible in the camera range. I wanted to trigger something when that object is fully visible. Thanks though!

Hi @donnav,

Thanks for your question!

This can indeed be done in Studio by utilising the trigger leave event that is linked to trigger regions.

I have created an example project to help with the explanation, it can be downloaded here: TriggerLeaveExample.ZPP (1.0 MB)

The project has a 3D model of a cube in the center of the tracking image. The cube color will change depending on whether the user is close to the object or far away. This same method can be used to make the user move the device further from the target, in turn making an event run.

The example was developed by surrounding the cube and the target with a trigger region. Along with this, there is also an interaction plane with its relative to property set to Z.screen. Both the trigger region and the interaction plane both have the same trigger tag assigned to them. As seen below -

TriggerTagInteractionPlane TrigggerTagTriggerRegion

Scene

As the plane is relative to the screen, when the user moves the device out of the trigger region, the plane follows. This causes a trigger leave event as both the plane and the region have the same tag. The trigger leave event can be accessed multiple ways, scripting or actions.

For this example, we have chosen to use actions. These actions activate the specific grey/red cube states based on whether the trigger enter or trigger leave event is called.

Hope this helps and please let us know if you have any further questions on this.

All the best,
George

5 Likes

Wow. You put in a lot of work. Thanks so much!

3 Likes