Magic Leap 2 - Image Target Misalignment Issue with Vuforia & Unity6

Environment:

  • Unity Editor Version: 6000.0.037f1
  • Magic Leap SDK Version: 2.6.0
  • Magic Leap MRTK3 Version: 1.4.0
  • OpenXR Plugin Version: 1.14
  • Vuforia Engine AR Version: 10.27.3

Issue Description:

I am developing an AR application using Unity 6, Vuforia, MRTK3, and Magic Leap 2. The goal is to overlay a 2D green border precisely on a QR code (Image Target) detected by Vuforia. However, I am facing a consistent issue where the green border does not align correctly with the QR code.

  • The green border appears significantly to the left of the QR code instead of being centered on it.
  • When moving or rotating the QR code while wearing the Magic Leap 2, the green border follows the motion perfectly, meaning that tracking works but with an offset.
  • Other UI elements, such as a HUD info panel (which is a Canvas in Screen Space - Camera), display correctly and remain in place as expected.

Setup Details:

  • The green border is a 2D sprite image, not a Canvas.
  • The green border is a child of the detected QR code (Image Target).
  • MRTK XR Rig is used, with Vuforia’s AR camera script attached to the main camera.
  • Only one camera is used in the setup.
  • Vufoira Extended Tracking is enable

What I Have Tried So Far:

  1. Changing the Image Target’s Physical Size
  • The actual printed QR code size is 5cm × 5cm (0.05m in Unity units).
  • Tested with different sizes (1m, 0.3m, etc.), but the offset issue persists.
  1. Resetting Transforms
  • Set all objects to (0,0,0) in local space.
  • Ensured Image Target scale is (1,1,1).
  • The issue remains.
  1. Testing with 3D Objects
  • Added a 3D cube on the Image Target to check if it was a 2D-specific issue.
  • The cube also appears offset, meaning the problem is not limited to 2D sprites.

Request for Help:

Has anyone encountered a similar offset issue when working with Vuforia Image Targets on Magic Leap 2?

Would appreciate any guidance on how to properly align AR elements so that they appear exactly on top of the detected image target!

Thanks in advance!

Sorry to hear that you are running into this problem. You may need to reach out to vuforia directly to get more information. The offset might be due to a limitation of the image resolution or it might be a bug in their SDK. But they would be able to give you more information.

One thing you could try, I don’t know if it would affect it, is to either disable or enable the Secondary View feature in your OpenXR settings in your Unity project.