Getting Started with AR Cloud Anchors: The Future of Augmented Reality: Part II: Setting Up Your Unity Project

Render Scripter
Antaeus AR
Published in
4 min readAug 21, 2024

For those who don’t want to build the app you can see the video and think Why Authentication setup is important?

In my previous post, Getting Started with AR Cloud Anchors: The Future of Augmented Reality — Part I, we explored the transformative potential of AR Cloud Anchors. This post will take you through the essential steps to set up your Unity project, enabling you to start working with AR Cloud Anchors right away.

Step 1: Setting Up Unity for AR Development

First, you’ll need to ensure that you have the correct version of Unity installed. Unity regularly updates its AR support, so I recommend using a version that is compatible with ARCore and ARKit. Once Unity is installed:

  1. Create a New Project: Open Unity, select ‘New Project,’ and choose the 3D template.
  2. You can also clone the project from github repo https://github.com/renderScripter/ar-cloud-anchors-tutorials.git

Step 2: Adding the ARCore Extensions

Next, you’ll need to add the ARCore Extensions package to your project:

  1. Open Unity Package Manager: Go to “Window” > “Package Manager.”
  2. Install ARCore Extensions: Click on the “+” button in the top-left corner and select “Add package from git URL.” Enter the GitHub URL for the ARCore Extensions package.
  3. Verify Installation: Ensure the package is correctly installed by checking if ARCore Extensions appear in your project.
  4. Import Samples: Import the samples into the scene. This will be our base for the project.

This step also ensures compatibility with ARKit, allowing you to develop cross-platform AR experiences.

Step 3: Enabling Cloud Anchors

With ARCore Extensions added, you can now enable Cloud Anchors:

  1. Enable Cloud Anchors: In the ARCore Extensions component, check the box to enable Cloud Anchors. This will allow your AR experiences to be shared and persisted across multiple devices. To do so, open Project Settings, go to “Edit” > “Project Settings” > “XR Plug-in Management” > “ARCore Extensions” > “Optional Features” > “Cloud Anchors”
  2. Authentication Strategy: Set the Android Authentication Strategy to Keyless. To support iOS, enable ‘iOS Support Enabled’ and configure the iOS Authentication Strategy to use an Authentication Token

Step 4: Setting Up a Google Cloud Project

To use Cloud Anchors, you need to set up a project on Google Cloud:

  1. Create a Google Cloud Project: Go to the Google Cloud Console and create a new project.
  2. Enable ARCore API: In the API Library, search for the ARCore Cloud Anchor API and enable it for your project.
  3. Set Up Credentials: We will setup credentials in the next blog.

Step 5: Setting Up Budget Alerts

Managing costs in Google Cloud is crucial, especially when working with APIs:

  1. Budget and Alerts: In the Google Cloud Console, navigate to “Billing” > “Budgets & alerts.” Create a budget for your project and set alerts to notify you when spending approaches your limits.
  2. Monitor Usage: Regularly check your usage to ensure you’re staying within your budget.

Conclusion

Following these steps, your Unity project should now be set up and ready for AR Cloud Anchor development. This foundational setup will enable you to create persistent, shared AR experiences that work across different devices.

If you’re interested in a more structured learning path, I am also developing a course that will be available on Udemy that will dives deeper into these topics and beyond. Additionally, you can access the code examples from this tutorial and future ones on my GitHub repository, which is free to use and explore.

In the next blog, we’ll dive into a crucial aspect of AR Cloud Anchors: authentication. If you’ve followed the steps to build the sample application, you will something missing. Stay tuned to learn how authentication ensures secure, consistent, and scalable AR experiences across devices.

Happy coding, and stay tuned for more insights into AR Cloud Anchors!

--

--

Render Scripter
Antaeus AR

Tech enthusiast and Software Engineer with expertise in full-stack development across Robotics, Web, Automotive, Mobile, IIoT, and VR/AR/MR.