Getting Started with RealityKit: ARCoaching

Part 3: Natively helping your users anchor themselves with an ARCoachingOverlayView

One of my favourite things to come out of this year’s ARKit updates has got to be the new ARCoachingOverlayView; it is a way to help. If leveraged correctly it can also be the ideal tool for developers to know when the best time is to add your objects to the scene. A main reason it’s one of my favorites is that it is incredibly easy to set up.

This view can be used in any ARSession, so it does not care whether you’re using RealityKit, SceneKit or Metal. The steps for achieving this, after adding your ARCoachingOverlayView to the app window, are:

  • Set the coaching view’s goal. See the Goal options by clicking here. The options include: horizontalPlane, for anything like a table-top or the floor; verticalPlane, this could be a wall or a big painting, ideally a wall with a bit of contrast; anyPlane, which is of course will complete on any of the previous two; and finally tracking, which is when ARKit is comfortable that it has enough feature points to be able to position things well. notably no face or object tracking states there (yet)
  • Set the coaching view’s session to your ARSession. This is how it will know when your goal has been achieved.
  • Optionally you can also set the delegate. This is ideal if, for example, you only want to add objects to the scene once you know that the AR tracking is stable using callbacks found in the ARCoachingOverlayViewDelegate protocol.

Doing just those things outlined above, with the goal being set to .horizontal, you’ll be able to get an overlay view that looks like the one below.

ARCoachingOverlayView animations on a black background

Let’s see what this looks like in code:

extension ARView: ARCoachingOverlayViewDelegate {  func addCoaching() {    // Create a ARCoachingOverlayView object
let coachingOverlay = ARCoachingOverlayView()
// Make sure it rescales if the device orientation changes
coachingOverlay.autoresizingMask = [
.flexibleWidth, .flexibleHeight
// Set the Augmented Reality goal
coachingOverlay.goal = .horizontalPlane
// Set the ARSession
coachingOverlay.session = self.session
// Set the delegate for any callbacks
coachingOverlay.delegate = self
// Example callback for the delegate object
func coachingOverlayViewDidDeactivate(
_ coachingOverlayView: ARCoachingOverlayView
) {

That’s the delegate, session and goal all set; the order of these 3 does not matter FYI. I’ve also made use of the delegate to show how you might call an action once the ARCoachingOverlayView completes, with the use of the coachingOverlayViewDidDeactivate method. Bear in mind that if your user loses tracking the overlay may popup again; if you want to avoid this from then adding your objects to the scene twice then either turn off the automatic triggering for the overlay with the activatesAutomatically property, or do a simple check with a bool or otherwise to check if the coaching has completed previously.

ARCoachingOverlayView detecting a horizontal plane and adding objects to the scene (speed 1.5x)

To see this running yourself, you could clone the GitHub repository; which I aim to have supporting all RealityKit features over the next few months. The file where the ARCoachingOverlayView examples are in can be found here:

That’s all there is to getting started with a ARCoaching, I hope this article has helped to show how useful and elegant this View is, and we start to see it in many apps after iOS 13 is released.

As usual, if you found this helpful please give this post some 👏👏👏, leave a response if you think there’s something important I’ve missed out, and keep an eye out for the next article in the coming weeks!

Click the link below for the main article in this series, which links to all the sections.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Max Cobb

Max Cobb


Excited about all things Augmented Reality! Developer Evangelist at