itracker kb

How to Combine ImageTracker and WorldTracker in Unity WebAR

Learn how to combine Imagine WebAR ImageTracker and WorldTracker in a single Unity WebAR project, including extended tracking setup, WebGL template configuration, performance tips, and common troubleshooting steps.
discord round color icon

A solution from our developer community

This article is based on a real question in the Imagine WebAR Discord community and includes examples and solutions from developers

Imagine WebAR ImageTracker and WorldTracker can be combined in the same Unity WebAR project, allowing an experience to begin from an image target and continue using world tracking.

Note: Combining ImageTracker and WorldTracker is an experimental workflow. Depending on your project, device, and plugin versions, additional configuration or optimization may be required.

Video Tutorial

The updated tutorial below demonstrates how to set up ImageTracker and WorldTracker together, including an extended tracking workflow.


What Can You Build?

One common use case is extended tracking. ImageTracker initially detects and positions content using an image target, while WorldTracker provides world tracking after the target is no longer visible.

You can also use both trackers independently within the same experience. For example, an image target could trigger an interaction that subsequently places separate content using WorldTracker.


Important Setup Notes

  • Import WorldTracker first.
  • Before importing ImageTracker, duplicate the WorldTracker WebGL template folder and use the duplicate as the basis for your combined template.
  • Import ImageTracker and merge the required ImageTracker files into the combined template as demonstrated in the video.
  • When combining the OpenCV files, use the WorldTracker version of opencv.js rather than the ImageTracker version.
Why duplicate the template?
Some ImageTracker and WorldTracker template files may share Unity GUIDs. Importing one package after the other can therefore overwrite files in the existing WebGL template. Duplicating the WorldTracker template first creates new GUIDs and prevents the duplicate from being overwritten.

Extended Tracking

For an extended tracking setup, the ImageTarget can be parented to the WorldTracker MainObject. ImageTracker can establish the initial position while WorldTracker maintains the experience when the image is no longer visible.

If required by your implementation, enable:

ImageTracker.DontDeactivateOnLost

This prevents the ImageTarget content from automatically being deactivated when the target is lost.


Performance

Running ImageTracker and WorldTracker simultaneously requires more processing than running either tracker independently. The ImageTracker detection phase can be particularly demanding.

If performance is low, try reducing:

  • ImageTracker → Max Frame Size
  • ImageTracker → Max Frame Area
  • WorldTracker → Max Pixels

Lower values reduce the amount of image data processed by the trackers and may improve frame rate, particularly on mobile devices.


Troubleshooting

The WebGL template loses files after importing the second tracker

Duplicate the WorldTracker WebGL template before importing ImageTracker. Do not simply rename the existing template folder.

OpenCV errors appear after combining the trackers

Make sure your combined template uses the WorldTracker version of opencv.js. Also verify that the required ImageTracker JavaScript files have been merged into the combined template.

WorldTracker produces errors during placement

If your project uses the Two-Finger Drag component, try removing it. If two-finger dragging is required, attach the behaviour to the WorldTracker MainObject so that it is not called during placement mode.

Tracking performance is significantly lower

This can occur because both trackers are processing the camera feed simultaneously. Reduce the tracker processing resolutions using the settings described above.


Current Status

ImageTracker and WorldTracker can run together, but combined and extended tracking workflows should still be considered experimental. Test your implementation thoroughly across the mobile devices and browsers you intend to support.


Community Multi-Tracker Template Creator

Community member Watanoge is also developing a Multi-Tracker Template Creator designed to simplify the process of combining multiple Imagine WebAR trackers without manually editing the WebGL template HTML.

The tool can generate templates for both single-tracker and multi-tracker projects and provides several configuration options directly inside the Unity Editor.

Features demonstrated so far include:

  • Generate WebGL templates for different combinations of Imagine WebAR trackers.
  • Configure tracker settings without manually editing the HTML template.
  • Select the MediaPipe source for FaceTracker, HandTracker, and BodyTracker: local models, MediaPipe CDN, or a custom URL.
  • Choose the camera facing mode (user or environment).
  • Verify scenes and tracker configurations before generating the template.
  • Identify scenes that may be missing trackers enabled elsewhere in the build configuration.
  • Locally host WebGL builds using self-signed SSL certificates for testing on other devices, including mobile devices on the local network.

Camera resolution controls are also being considered, allowing camera configuration to be changed from the Unity Editor instead of modifying the generated HTML manually.

Community Project: This Multi-Tracker Template Creator is a community-developed tool and is separate from the standard Imagine WebAR tracker packages. It may provide an easier workflow for projects that need to combine multiple tracker types.

Source: Imagine WebAR Developer Community
Originally discussed December 2023 – June 2026.



Source: Imagine WebAR Developer Community
Based on developer discussions and testing from 2023–2025.

Related Articles

Discover more from Imagine WebAR

Subscribe now to keep reading and get access to the full archive.

Continue reading