How to implement QR code scanning on a unity hololens2 app

%3CLINGO-SUB%20id%3D%22lingo-sub-2249082%22%20slang%3D%22en-US%22%3EHow%20to%20implement%20QR%20code%20scanning%20on%20a%20unity%20hololens2%20app%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2249082%22%20slang%3D%22en-US%22%3E%3CP%3ECan%20any%20one%20please%20let%20me%20know%20about%20the%20procedure%20of%20QR%20code%20scanning%20on%20a%20unity%20hololens2%20app%20.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EEX%3A%20I'm%20looking%20for%20when%20the%20user%20see%20from%20the%20HL%20through%20a%20QR%20code%20i%20want%20to%20show%20case%20a%20short%20video%20clip.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20in%20advance%20.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2249082%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EHoloLens%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMRTK%20Unity%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMRTK%20Unreal%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EUnity%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
New 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