Forum Discussion

PeterRatchetBoy's avatar
4 months ago

QR code tracking problems, object doesn't spawn at scanned qr code everytime.

I am trying to create an app with qr code tracking, at first it went perfectly well, just for the first time only, object was spawned at qr code object where I wanted.

But the second, third and next time and on and on. Whenever I scan qr code, the object keep be spawned at different places. I keep changing places where I start my app, at first I thought that was the reason for this problem, but even if I go back to the same place that it was spawned at the right place, this time the object was spawned where I didn't want instead.

I have enabled 

  • Anchor Support
  • Scene Support
  • Experimental features
  • Permission Requests On Startup >> Scene
  • QR Code tracking

, which are required for QR code tracking function. So I really don't know why this keep happening.

I have tried "save my perference" and "not save my perference" for spatial data request when the app is starting. And the results are the same. I have no more idea to try.

Please help me, Thank you.

5 Replies

  • Could you share the script that reads the QR code and spawns the object? 

      • PeterRatchetBoy's avatar
        PeterRatchetBoy
        Explorer

        I used meta botton to reset position before I scan qr code after I re-enter the application, and the objects spawn at the place I want almost everytime.

  • Hello there PeterRatchetBoy!

    I understand you're having trouble implementing QR Code tracking in your app.

    Since you mentioned the object spawned in the right place the first time, but not on later attempts, I'd suggest that you check your anchor persistence and make sure that you are saving the anchor or spatial node associated with the QR code and reloading it on subsequent app launches. If you're still having the issue, you could also try a minimal project with just QR code tracking and anchor persistence to try isolating the issue. 

    Additionally, try to make sure your app’s world/session origin is set consistently, especially after relaunching or resuming the app. If you're doing this on a Quest, you can “relocalize” (i.e. restoring the app’s spatial context so objects appear in the same place across sessions) to a previously saved spatial map. I'll attach some of our documentation below that hopefully should help point you in the right direction if you haven't seen them yet. 

    Hopefully you found some of this helpful, and if not please feel free to let me know and we can investigate further!

    Track QR Codes in MR Utility Kit
    Spatial Anchors

    -G

    • PeterRatchetBoy's avatar
      PeterRatchetBoy
      Explorer

      Thank you for your answering.

      I will try to implement the script as you say.

→ Find helpful resources to begin your development journey in Getting Started

→ Get the latest information about HorizonOS development in News & Announcements.

→ Access Start program mentor videos and share knowledge, tutorials, and videos in Community Resources.

→ Get support or provide help in Questions & Discussions.

→ Show off your work in What I’m Building to get feedback and find playtesters.

→ Looking for documentation?  Developer Docs

→ Looking for account support?  Support Center

→ Looking for the previous forum?  Forum Archive

→ Looking to join the Start program? Apply here.

 

Recent Discussions