No-BS guide to set up Unity for AR!

Kushagra Goel
5 min readApr 3, 2022

If you are reading this, it can be ascertained that you have scoured the internet to properly set up the unity editor to enable AR development without any hassle, but only found bits and pieces scattered all over.

Heed no further as this will be a to-the-point no-bullshit guide to set up unity for AR development. And there will be a few more steps for a smooth start than you might have thought.

A quick disclaimer: The original plan was for me to use it for reference for myself since there is no one correct way to set this up but this will be helpful to anyone getting started with AR or coming back to it after a long time. Familiarity with the Unity editor will be a plus.

Without any further ado, let’s get started:

Configuration

I recommend using Unity 2020.x.x LTS as I believe that it will be the next big version for some years as Unity 2018.x.x has been. Furthermore, it has removed a lot of the deprecated features that create discrepancies when fiddling with settings and building your project.

Make sure to have the following modules installed:

  • Android Build Support
  • Android SDK & NDK Tools
  • OpenJDK

I will show how to set up only ARCore development for Android devices as of now, due to the lack of better hardware for testing ARKit development for iOS devices. For this, we will be using the ARFoundation package that now comes built-in with unity editor.

Following through

Just open Unity Hub and create a new project as follows:

create a new project using the 3D (Core) preset in unity 2020.3.x LTS version
Creating a new project using the 3D preset

Now, wait for the project to open. When the project opens, you will need to install some packages from the unity package manager. In the menu bar, go to

Window > Package Manager
go to Window > Package Manager

A new window named “Package Manager” will pop up. Firstly, make sure that “In-Project Packages” are selected in the menu bar.

Then click on AR Foundation and press install. You might have to download it first if you haven’t done it already. Follow the same instructions for ARCore XR Plugin and Universal RP by scrolling down some.

install AR Foundation and ARCore XR Plugin from Package Manager

After some loading and waiting, close the package manager when all of these three packages have been downloaded.

Now, we need to change the render pipeline to a universal pipeline. For this,

  • right-click in the “Project” window
  • create a folder and name it “Rendering” (this step is purely for convenience and is not necessarily required)
  • open the newly made folder and right-click again, then open:
Create > Rendering > Universal Render Pipeline > Pipeline Asset (Forward Renderer)
  • This will create two new files in that location of which, click on the second one named UniversalRenderPipelineAsset_Renderer
  • Go to its inspector panel and click on Add Renderer Feature
  • From the dropdown menu, click on AR Background Renderer Feature

That’s it for setting the URP scripts, now we actually need to enable it for the whole project. For that,

  • In the menu bar, go to
Edit > Project Settings > Graphics
  • In the field below “Scriptable Render Pipeline Settings”, click on the dot-circle button at the right and from the new prompt, select the newly made render file.
  • Once again go to the menu bar and do the following:
Edit > Render Pipeline > Universal Render Pipeline > Upgrade Project Materials to UniversalRP Materials
  • In the prompt, that follows, click on proceed.

This will upgrade all the materials already present in the project and the ones to be used for the Universal Render Pipeline.

Now we will change the platform of this project to Android and change the settings corresponding to that. Firstly, in the menu bar, go to

File > Build Settings

This will open a new window, from which select Android and click on switch platform. This operation will take a while to complete. After it is complete, open Player Settings from the same window which will open a new window. Things are about to get complex from here as we will need to change a lot of settings and I will not be able to add a lot of images, so follow carefully.

  • Expand the “Other Settings”
  • In the Graphics APIs, click on Vulcan and remove it
  • Scroll down and uncheck the box named “Multithreaded Rendering”
  • Scroll further down, in Configuration>Scripting Backend dropdown, select IL2CPP
  • Scroll down and check the “ARM64” checkbox
  • Now in the left panel, select XR Plugin Management and check the ARCore checkbox

Congratulations! If you followed all these steps carefully, you are now ready to create awesome new experiences in AR for Android devices.

You can now find numerous tutorials that take ahead from this step. Also, as I promised earlier, I did not go deeper into why we did what we did (although I could have) to make this guide as concise as possible.

Hope that this was of some help to you✌️

If you like the article, you can always

--

--