# Image tracking initialization issue

**URL:** <https://forum.8thwall.com/t/image-tracking-initialization-issue/1273>\
**Category:** Technical Support\
**Created:** [May 3, 2024, 12:56pm UTC](https://forum.8thwall.com/t/image-tracking-initialization-issue/1273 "2024-05-03T12:56:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jose\_burga](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@jose\_burga](https://forum.8thwall.com/u/jose_burga)\
**Post date:** [May 3, 2024, 12:56pm UTC](https://forum.8thwall.com/t/image-tracking-initialization-issue/1273/1 "2024-05-03T12:56:09Z")

</div>

Hi there.

i experience a problem while tracking within the image tracking framework (using PlayCanvas).

i basically use the events:

```auto
this.app.on('xr:imagefound', showImage, {});
this.app.on('xr:imagelost', hideImage, {});

```

those events handles some ui elements to guide the user.

```auto
const showImage = (detail) => {
    if(!arPlaced)
    {
        arPlaced = true; 
        _uiController.uiSwitch("ar_mask", false);
        _uiController.uiSwitch("tutorialOverlay", true);
        // enable ar placement screen
        _uiController.tutorialOverlay("arPlacement", true);
        
    } 
    _uiController.debugText.element.text = "image visible";
}

const hideImage = (detail) => {
    _uiController.debugText.element.text = "lost image";
}

```

Now the problem: our customer told me, that sometimes the image is detected but the 3d object isnt visible / enabled / active. (I’m debuging on screen with the debugText element if the imageTarget is recognized). I cant figure out, why the 3d object the framework should enable isnt directly visible if showImage is called (which basically indicates, that the framework recognized the imageTarget correctly)

Is there a fix i could do? Or should i use another eventlistener, to handle the ui if the 3d object, which should be placed is active? can i check for this?

Thanks for your inputs!

---

<div class="post-metadata">

**Author:** ![jose\_burga](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@jose\_burga](https://forum.8thwall.com/u/jose_burga)\
**Post date:** [May 3, 2024, 1:04pm UTC](https://forum.8thwall.com/t/image-tracking-initialization-issue/1273/2 "2024-05-03T13:04:28Z")

</div>

Edit: Is there a eventlistener i could use to call the showimage function only if the 3d object is visible? This would help to prevent, that the ui is moving forward, and no 3d object is visible.

---

<div class="post-metadata">

**Author:** ![Evan](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.8thwall.com/evan/32/431_2.png) [@Evan](https://forum.8thwall.com/u/Evan)\
**Post date:** [May 3, 2024, 9:22pm UTC](https://forum.8thwall.com/t/image-tracking-initialization-issue/1273/3 "2024-05-03T21:22:26Z")

</div>

Have you attached the namedimagetarget script to the object? If it’s a 3D model, what’s the size (MB)?
