How to implement QR code scanning on a unity hololens2 app

Copper Contributor

Can any one please let me know about the procedure of QR code scanning on a unity hololens2 app .

 

EX: I'm looking for when the user see from the HL through a QR code i want to show case a short video clip.

 

Thanks in advance .

3 Replies
Qr codes are actually pretty easy, and I've got a collection of examples that you may find helpful :)

The first one I've got here is a sample I wrote for StereoKit. It's not Unity, but I did try my best to distill the QR code API into an extremely simple example. It's like, 40 lines of code or so, so it should be pretty easy to pick out the relevant bits and do the same in Unity :)
https://stereokit.net/Pages/Guides/Using-QR-Codes.html

There is also the official sample, which is referenced by the API docs. It's Unity based and uses the MRTK. It has some extra frameworkification to it, so it's a bit harder to parse, but the environment might be a bit more familiar for you.
https://github.com/chgatla-microsoft/QRTracking

Then there's also the quick API reference over here! The API itself is pretty simple and mostly self explanatory. I actually referred to this much more than anything else when writing the StereoKit sample :)
https://docs.microsoft.com/en-us/windows/mixed-reality/develop/platform-capabilities-and-apis/qr-cod...

Hope that helps!
Hi Koujaku,
I tried downloading the unity package from the GitHub and successfully the unity package called sample qr codes while i running it from the unity some default codes that have built in on the scene was not working atm and it was showing some issues on the code which they have provided to me.

so atm i'm still working with the code to test how to works to scan the qr code and i'm wondering i have installed all nuget packages along with the github package file and with mixed reality setup on unity scene file .

Do you have any tutorial on how this process goes that would be very helpful and btw i tried to source on youtube too but un-fortunately i am getting a lot of other things .

Thank you for your reply.

 

I'm afraid I don't know too much about the Unity side of things these days! I know that a lot has changed recently related to XR plugins, so you might have better luck with that Unity project if you make sure you're matching Unity versions exactly, and then branching off later.

You could also try asking the technical team over on the Q&A site hololens tag, they're likely way more up-to-date on Unity stuff than I am!
https://docs.microsoft.com/en-us/answers/questions/topics/single/334091.html