Blog

Vuforia Migration to AR Foundation

Written by Admin | Jan 16, 2022 8:18:00 PM

Why Vuforia in the First Place?

We initially used Vuforia to develop AR apps because it synergized with Unity and could be installed as a module. Vuforia is one of the biggest AR solutions out there for Unity. It was verified by and came bundled with Unity, so we would be certain that it worked. 

After Unity 2019.2.0 released, it stopped bundling Vuforia in its versions. In our case, we had already migrated to AR Foundations prior to this change.

Why Migrate to AR Foundations?

We made the jump from Vuforia to AR Foundations for a number of reasons, mostly related to Vuforia’s limitations and lack of support. Vuforia didn’t offer enough resources and examples for what we needed. During development, we sometimes run into issues and have to contact support with time-sensitive questions. But questions often went unanswered on the Vuforia forum, or the support team took a very long time to respond. The slow support or lack thereof was not ideal.

We wanted to keep Vuforia updated to the latest version, which included important bug fixes. However, this didn’t work well with Unity Cloud Build. We were able to update Vuforia manually, but it was difficult to make local builds work as expected since Unity Cloud Build will always make builds with the Vuforia version that came bundled with the project’s Unity version. 

This means updating Vuforia manually has no effect for cloud builds . This isn’t ideal because we would have to keep updating the project’s Unity version if we wanted to use an updated Vuforia version. Not only is this time-consuming, but updating Unity versions could introduce new bugs. 

In one such instance, Apple launched their new iOS version for the iPhone 13, which wasn’t compatible with our current Vuforia version. So the AR functionality was broken for iPhone 13. To fix this, we had to update to the latest Vuforia version, which meant we also had to update to a Unity version that included the new release.

The switch to AR Foundation made sense because the software is being developed by Unity itself. This meant more resources and better support . There was also more activity on the forums. Finally, updating AR Foundation versions doesn’t break Unity Cloud builds, eliminating that issue entirely.

Migration Process

Migrating code from Vuforia to AR Foundation went relatively smoothly. Initiating AR and surface detection is somewhat different with AR Foundation. Luckily, the change wasn't too difficult with the help of plentiful AR Foundation examples. Our AR UX remained the same, so no conversion was needed there.

The only disadvantage of AR Foundation we noticed is that it’s not possible to simulate surface detection in the Unity editor. With Vuforia, you can perform surface detection by using a webcam and a predetermined image for image tracking. This means you can use your webcam to scan a printed image that acts as a surface.

With AR Foundation, there is no such feature. The only way to debug surface detection UX flows is to build it for the device or by faking a surface placement in the editor. This has limitations, but luckily we can debug most things for our AR experience in the editor. Although we always want to double check it on the device just to be sure.