Center screen content on Tracking Unseen



I want to center screen (Basically reset) the group / content when the tracking image goes out of vision. I have done something like this, but its not working as expected…

var flyer_jpgzpt0 = parent;
var group0 = symbol.nodes.expandedModel;
parent.on(“notseen”, () => {
group0.position([0, 0, 0]);
group0.rotation([0, 0, 0]);
group0.scale([1, 1, 1]);

Actually what I want to do is when we move the camera the group also moves according to the tracking image and this way sometimes the group goes out of the screen completely. When this happens and user keep moving the camera then the tracking image unseen event is fired. I also wanted to animate the group and set it at the center of the screen with rotations and scales set to 0. I am not sure how to do a timeline where the target will be animated from its current position (This is variable as group keeps moving with the camera movement on tracking image) to a defined position (center screen).

Can someone help me please.



I don’t know if I understand all that your asking for but as for the part with the time line and current position you just need to “link” the start of the time line to the first time spot (-# to 0) then it will play from wherever you move it to.

Ps. If you can give me some more details I can try to help more.


Hi Steve,

I have no idea on how to set the initial values for the timeline. Here is the screenshot of the timeline. Can you guide me how shall I set the initial values, so that it animates from the current position of the target?


This is the latest timeline, but the group won’t move to the specified position on UNSEEN…

var flyer_jpgzpt0 = parent;
var group0 = symbol.nodes.expandedModel;

parent.on(“notseen”, () => {
Z.after(100, function(){

Please help :frowning:


Looks like you got the time line set. Did you change your relative to property from the target image to the Z screen?



How do I do that Steve?


The fastest way to help is for you open a new project. In the examples there is a project in ZapWorks Studio that shows this behaviour in action called “Tracking Grab-and-Go”.

From there I would copy the things to your code.



Thanks Steve, I’ll look into that example.


Hi Rakesh,

Have you had a chance to look through the Tracking: Grab-and-Go example that @stevesanerd mentioned?

If you still have any questions after doing so let me know.