# AR Fundamentals: Plane Detection

---

![](https://cdn-images-1.medium.com/max/2400/1*KnoaOt3ixuU6woSBF2wGDw.jpeg align="center")

Source: [GitHub](https://github.com/Unity-Technologies/arfoundation-samples/issues/186)

#### **What is Augmented Reality?**

![](https://cdn-images-1.medium.com/max/1600/1*6rKeKqjGu_uSnt0q7xd7mQ.png align="center")

While scrolling through Instagram (or Tik Tok), you may have come across the “*gibberish game”* or the “*name-place-animal-thing challenge*”; or have you ever played the game “*Pokémon Go*”?

If you have, then you probably already know what Augmented Reality is. Augmented Reality (AR) can be defined as any technology that “*enhances*” or “*augments*” your experience of the world around you.

Filters and games are just a few examples of how AR is used. The applications of AR tech are limitless, it is used for interior design, for education, for marketing, by Car mechanics, in Medical training and much more.

#### **Getting started with AR**

In this article, I will help you get started with AR development by explaining the implementation of Plane detection (and tracking)with various SDKs (Software Development Kits) using Unity.

The first thing you need to do is install Unity Hub from [here](https://unity3d.com/get-unity/download). (Tip: If you are enrolled in the [GitHub Developer Program Member](https://education.github.com/pack) program, you can use the Unity Student plan for free).

Next, choose a version of Unity.

![](https://cdn-images-1.medium.com/max/1600/1*6poI2OuC5MbVa-MQSGbfoA.png align="center")

A LTS(Long Term Support) version is more stable and hence better for beginners.

![](https://cdn-images-1.medium.com/max/1600/1*JjLyS82P8jQO-GO6FYWFrQ.png align="center")

Be sure to select the Android Build Support option.

Now that you have installed Unity, create a project with the “3d” template.

Once the scene is rendered, a few steps need to be followed before we can start.

Step 1: Go to File -&gt; Build Settings

![](https://cdn-images-1.medium.com/max/1600/1*AXmI8gMs034cJMcK_-ZnPA.png align="center")

Step 2: Select Android and switch platform.

![](https://cdn-images-1.medium.com/max/1600/1*Pjm019CYDd4fxwqkwF0h9g.png align="center")

Step 3: Open Player Settings and change “Graphics API” to “OpenGLES3” and change “Minimum API Level” to “API level 24”.

![](https://cdn-images-1.medium.com/max/1600/1*tq-oAIWg2XNB52X8HB9MYA.png align="center")

![](https://cdn-images-1.medium.com/max/1600/1*HVtUP6DGBQpXPhh0DC9gvw.png align="center")

Step 4: Click on XR Plugin Management and select AR Core.

![](https://cdn-images-1.medium.com/max/1600/1*kmx8W1WR4-seJQZySiqw2g.png align="center")

Step 5: Open Window-&gt; Package Manager, and install the following packages.

![](https://cdn-images-1.medium.com/max/1600/1*uxPiSyyJK7Cf2vo7G8nXpQ.png align="center")

There are many ways to implement plane detection in Unity, but I will explain a method in which **no code** is required.

The first thing, we need to do is remove the “Main Camera” from the Hierarchy.

Then right click in the Hierarchy to see the following options.

![](https://cdn-images-1.medium.com/max/1600/1*LO2wF88wr3upr9_iyOBzjg.png align="center")

Select XR and import the following:

![](https://cdn-images-1.medium.com/max/1600/1*tCEKWqOBnGGeBLNjXjCULg.png align="center")

Select AR Session Origin and make the following changes.

![](https://cdn-images-1.medium.com/max/1600/1*8Fpfdz_7iWp__n4hasr5AQ.png align="center")

Again we open File -&gt; Build Settings.

![](https://cdn-images-1.medium.com/max/1600/1*OmAmxCBmAYhfKFT_vgvbKA.png align="center")

Before we “Build and Run the project”.

Open “Developer settings” on your Android device and enable “USB Debugging” and then connect it to your PC.

We can now Build and Run our project.

Congratulations! You have built your first AR project 🥳.

---

GitHub Repository: [https://github.com/Thamanmuthappa/PlaneDetection](https://github.com/Thamanmuthappa/PlaneDetection)

---

If you were unable to run the project, feel free to reach out to me at:

LinkedIn: [https://www.linkedin.com/in/thaman-muthappa-m-n-540982204/](https://www.linkedin.com/in/thaman-muthappa-m-n-540982204/)

GitHub: [https://github.com/Thamanmuthappa](https://github.com/Thamanmuthappa)

Instagram: [https://www.instagram.com/t\_man.\_\_/](https://www.instagram.com/t_man.__/)

Email: [thamanmuthappa@gmail.com](http://thamanmuthappa@gmail.com)
