Search⌘ K

Plane Detection and Object Placement in AR

Explore how to implement plane detection in AR Foundation to identify horizontal and vertical surfaces. Learn to spawn and place 3D GameObjects on detected planes using touch interaction. Understand how to modify placed objects dynamically with user interface controls, preparing you to build interactive markerless AR applications.

AR plane detection in AR Foundation

AR plane detection is recognizing and following flat surfaces, such as walls, tables, or floors, in the physical environment by leveraging a mobile device’s camera. This functionality is commonly found in various AR applications, serving as a fundamental element to enable virtual objects’ precise and stable placement in the real world.

AR Foundation is a framework that enables the development of AR applications that function seamlessly on Android and iOS devices. One of the features that AR Foundation provides is plane detection, which facilitates the identification and tracking of flat surfaces in the real world.

In this lesson, we’ll cover the following:

  • How to set up AR plane detection
  • How to spawn 3D GameObjects in real space
  • How to change GameObjects in real space

AR project setup

Let’s start our plane detection. Create a Unity project, and import AR Foundation packages for our app development. Follow the structure instructions from the lesson “Environment Setup for AR Applications,” and create a complete structure to store prefabs, materials, scripts, etc.

Project structure
Project structure

We need to import ...