Step by step Beginner’s guide: Markerless AR with Unity 3D and Vuforia Engine

Vishnu Teja
Antaeus AR
Published in
7 min readJun 16, 2024

Creating immersive AR experiences in Unity 3D with Vuforia’s markerless AI technology can be a game-changer for developers and enthusiasts alike. Here’s a sneak peek into what you can achieve:

  • Seamless Integration: Vuforia’s advanced AI seamlessly integrates with Unity 3D, allowing you to create rich and interactive AR experiences without the need for physical markers.
  • Real-World Interaction: With markerless tracking, your AR objects can interact with the real world in real-time, providing a more natural and intuitive user experience.
  • Creative Freedom: Unleash your creativity by placing AR objects anywhere in the environment, opening up endless possibilities for storytelling and gameplay

In this beginner’s guide, I’ll take you step-by-step through the exciting journey of developing your own first AR application using the Vuforia Engine within Unity 3D.

If you are new to Unity 3D and are unsure about how to setup Unity Hub after installing Unity Hub from internet for the first time, please follow the Installing and setting up Unity Hub section

🧨 Setting up Unity 3D project with Vuforia Engine

🎯 When opening Unity Hub for the first time, you will land on the below UI

Landing on Projects tab for first time in Unity Hub

🎯 Navigate to the Projects tab in the vertical left menu and on the top right click New project. Select 3D Built-in Render Pipeline from All templates and give your project a name in the right side and click Create project

🎯 Once the project is created you will land on the below default UI which has a Main Camera and a Directional Light in the project hierarchy

Default 3D project creation view

🎯 Navigate to Window > Asset Store, you then would see an UI like below. Click on Search Online button and it will take you to the official Unity Asset store https://assetstore.unity.com/

Navigating to Assert Store via Window tab in Menu bar
Clicking ‘Search online’ to be able to search for assets from Unity asset store

🎯 Search for Vuforia Engine in the search bar, and once you see the below search result, open it

Vuforia Engine SDK in Unity asset store

🎯 Click on Add to My Assets, which will add the Vuforia Engine SDK to your Unity account Assets (this way you can access Vuforia Engine SDK in multiple future projects). This is a one time step per for any Unity account

Clicking Add to My Assets to add Vuforia Engine SDK to our Unity account assets

🎯 Once Vuforia Engine SDK is added to your Assets, you can choose either Open in Unity or you can manually add this package via Package Manager. Let us import Vuforia Engine SDK via Package Manager in this guide

🎯 Navigate to Windows > Package Manager. And choose My Assets in the dropdown list as shown below (Dropdown is visible when you click on Packages: xxxxxx tab)

Accessing My Assets via Package Manager and clicking the dropdown besides + icon

🎯 Search for Vuforia Engine via search bar and now you shall see that Vuforia Engine is available in your My Assets list. Make sure to click Download it first and then click Import and import all the Vuforia Engine assets

Vuforia Engine detected in My Assets

🎯 Once the Vuforia Engine import is done successfully, close the Package Manager window and make sure to configure Android settings as discussed in the Configuring Android Player Settings section

🧨 The CORE of the project

🎯 Delete the Main Camera Game Object by right clicking on Main Camera in the hierarchy and choosing Delete

🎯 Click + icon in the top left of hierarchy, then add an AR Camera by navigating though Vuforia Engine > AR Camera

Adding AR Camera to the scene hierarchy

🎯 Select AR Camera in hierarchy, and you would see Vuforia Behaviour script attached to it in the Inspector area.

Vuforia Behaviour (Script) is attached by default to AR Camera

🎯 Get your licence key from Vuforia Developer Portal and add it in the App License Key field as shown below. Save the project (Ctrl + S)

Adding license key which can be obtained from Vuforia Developer Portal

🎯 Click + icon in the top left of hierarchy, then add an Plane Finder and Ground Plane Stage by navigating though Vuforia Engine > Ground Plane > Plane Finder and Vuforia Engine > Ground Plane > Ground Plane Stage

Adding Plane Finder and Ground Plane Stage to the scene hierarchy
After adding Plane Finder and Ground Plane Stage game objects to the scene hierarchy

🎯 Make Plane Finder as child object to AR Camera in the hierarchy

Making Plane Finder a child object of AR Camera via hierarchy

🎯 Drag and drop Ground Plane Stage game object from hierarchy to Plane Finder’s Anchor Stage field of Content Positioning Behaviour (Script) component

Setting Anchor Stage of Plane Finder to Ground Plane Stage

In the above component of Plane Finder, you can see an option called Duplicate Stage. Enabling this will make you place multiple 3D objects on the ground, else a single object (our case).

🎯 For this tutorial, we will use the existing 3D model from Asset store as our 3D game object. I have added the below to my assets from Unity Asset store (Animated Goat and Sheep- 3D low poly-FREE).

Adding Animated Goat and Sheep- 3D low poly-FREE to My Assets via Unity Asset store

🎯 Navigate to Windows > Package Manager, and Go to Package: My Assets and refresh the list (refresh button at bottom). You will then see, Animated Goat and Sheep- 3D low poly-FREE. Click Download and post that click Import

🎯 After successful import of the above asset, your project Assets will be updated. Navigate to Assets > UrsaAnimation > LOW POLY CUBIC — Goat and Sheep PAck > Prefabs_Standard. Drag and drop the one of the prefabs (SK_Sheep_white in my case) onto the hierarchy and make it a child of Ground Plane Stage game object as shown below.

Placing White Sheep prefab on the Ground Plane Stage

🎯 Place the prefab on the ground plane stage in the scene in such a way that the prefab borders align with in the boundaries of the ground plane.

🎯 In my case, I have choose 0.3 scale transform for the prefab and 1 scale transform for the ground plane. Both position at (0, 0, 0) co-ordinates

🎯 After the above steps are done, navigate to File > Build Settings. Add your scene to the Scenes In Build list if not added already. Select Android from the Platform list. And I hope you have configured your Android Player Settings (if not please look out this Configuring Android Player Settings section). Finally save your project and click on Build. Once the APK is generated and saved locally, you can transfer the APK file to your desired Android mobile phone (why not via WhatsApp 🤣) and install the application.

Final Result 🎊

GIF showing the working of the created AR app

Few erroneous cases 🥊

Case 1: Sometimes, you might face issues about the cache location as shown below.

In such cases, you can change the default cache locations by navigating to Edit > Preferences > Package Manager and the change the cache locations to any desired folder which will solve the issue.

Case 2: While downloading or importing Vuforia Engine from Package Manager:

  • You may be asked to agree to the Vuforia’s Software License agreement as shown below. In such cases make sure to click Accept
  • You may be asked to Update the project as shown below. In such cases make sure to click Update

Conclusion 🚀

Great work! Thank you for successfully reaching the end of the article . Your dedication and effort have paid off, and you’ve made your first app using Vuforia 👏.

We hope you found this guide helpful and inspiring. If you have any feedback or questions, feel free to reach out. We look forward to seeing what you create next with your newfound knowledge. Keep up the fantastic work, and happy coding 💻!

--

--