Roadblocks Ahead

Naomi C.Naomi C.
4 min read

Week one of the XR Quest went really well. I advanced on my AR business card app and got the basis for it working on my phone.

I had to cut down my project’s scope even more though. My first task had been to set up a Unity project for XR development and import the necessary AR packages. That was easy enough as I’ve done that before. Second task - not so easy. I thought it would be, but of course, there always has to be something to learn from.

The second task was to set up a basic AR scene and test the build on my phone. For this, I followed part of the Unity Learn Tutorial Get started with AR: Configure your AR development environment except I set it up from scratch instead of using the files provided. The problem though was when I built it to my phone. All I was seeing was a black screen instead of what the camera was seeing.

Rotating augmented reality cube with black screen behind.

Another person in the cohort had the same problem, but his solution - activating the AR camera manager - didn't work for me. I looked through a bunch of forums online, but none of the solutions there worked either. Eventually, I went back to my good friend ChatGPT 😌 . It gave me a list of steps to go through to make sure the project worked as expected. We went through each step one by one. By step four out of eight, I'd found it: turns out I had accidentally deleted and forgot to re-add the AR session object in the hierarchy.

💡
AR Session Object: The AR session object is a container object that has components (AR Session and AR Input Manager) that are in charge of managing the life cycle, configuration options and tracking information for an AR session.

Once I put that back, it worked perfectly.

Rotating augmented reality cube with camera input behind.

For day three, I added avatar model support by importing the Ready Player Me Unity SDK and using the API.

💡
SDK: Software Development Kit - A set of software development tools provided in an installable package.
💡
API: Application Programming Interface - A software tool that lets different programs communicate with each other.

Ready Player Me lets you generate an avatar online, customize it and use it in games or development projects like this one. I'd played with the API a while back and imported my avatar into a test project in Unity.

That was back with the Ready Player Me version 1.13.1 Unity Package, so a few things had changed and, of course, another roadblock appeared. In the past, I imported the package by downloading it directly from the Ready Player Me site. Now, they support importing it with the Unity Package Manager and a git URL, except that didn't work as expected. I got errors saying it was unable to import certain dependent packages.

Ready Player Me package import error in Unity.

I thought of just using the old way (I still had the old downloaded package on my computer), but that might mean a lot of headaches if I wanted to upgrade it later. Reading the errors more closely, I realized the git URLs of the failed packages were given. So I tried importing the failed dependent packages separately - that worked! Another thing learned! I followed the instructions on the Ready Player Me site and used the API to import my avatar into the scene.

Ready Player Me avatar in Unity Editor

Another day completed!

Day four is where it got interesting with adding object tracking for the avatar. But this entry is long enough already so I'll make a part two.

#today-i-learned I can add sub-packages individually if the parent package fails to import. It's not the best solution for most packages and errors like this because dependency errors can be a hassle, but for this problem, it worked fine.

🕊 Make sure that your endurance carries you all the way without failing, so that you may be perfect and complete, lacking nothing. But if any of you lack wisdom, you should pray to God, who will give it to you; because God gives generously and graciously to all. (James 1:4‭-‬5 GNT)

0
Subscribe to my newsletter

Read articles from Naomi C. directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Naomi C.
Naomi C.

I am software engineering student passionate about immersive technologies and XR development for education and training purposes. When I'm not coding, I enjoy learning new languages and reading.