AR Foundation v5.0

What’s New in AR Foundation 5.0

Version 5.0 of AR Foundation is here and comes with several changes and new features. AR Foundation 5.0 works with Unity 2021LTS, Unity 2022.1 and is available in beta with Unity 2022.2.

Changes

For more information on migrating your project to 5.0, see the AR Foundation migration documentation.

New Features

  • XR Simulation allows you to run your AR app in Play mode by simulating an AR device, no longer requiring you to rebuild your app to test changes.
  • AR Debug Menu is a new Prefab you can use to view available configurations on your device and visualize AR subsystem data such as planes and point cloud positions.

Requirements

  • AR Foundation 5.0 requires Unity 2021LTS and later.

XR Simulation

AR Foundation can simulate an AR device, allowing the testing of AR enabled scenes in the Editor. In play mode you can navigate around a variety of simulated environments detecting planes, tracked images, etc. as if you are using a real device. You can also create your own environments to use in the simulation.

The following AR Foundation features are supported:

Enable simulation

Go to Project Settings > XR Plug-in Management > Windows, Mac, Linux and enable XR Simulation. When you enter Play Mode in the editor with a scene that contains an ARSession, a simulated environment is loaded. Click the right mouse button in the Game view to look around and press the W, A, S, and D keys to navigate around the environment.

As you navigate around the environment, AR Foundation discovers features of the simulated environment as if you were navigating around a real space. However, there are a few differences compared to using a real device:

  • Planes: Planes are only discovered on axis aligned surfaces.
  • Meshes: Meshes are all discovered immediately on entering play mode.
  • Tracked images: Any tagged image in the simulation environment can be tracked regardless of what images are in your reference library. This allows testing without having to modify either your reference image library or the environment.

For more in-depth information on how to set up and work with AR Simulation, please refer to the AR Foundation Simulation documentation. You can also watch a tutorial from AR Content Creator and Founder of LearnXR, Dilmer Valecillos, on YouTube.

Unity Mars and Simulation

Unity Mars includes a simulation feature that can work with AR Foundation. Unity Mars’ Simulation System supports the same features as AR Foundation and more. We recommend that Unity Mars developers continue with Unity Mars simulation. Note that both Simulations features cannot be used at the same time.

XR Origin

ARSessionOrigin is now deprecated and is replaced by XROrigin. The XR Origin represents the center of worldspace in an XR scene. The purpose of the XR Origin is to transform objects and trackable features to their final position, orientation, and scale in the Unity scene. It specifies an Origin, a Camera Floor Offset Object, and a Camera.

For more information on migrating ARSessionOrigin to XROrigin, see the AR Foundation migration documentation.

AR Debug Menu

You can add the AR Foundation Debug Menu to an AR scene to visualize tracking information and available configurations. When that scene is active on a target device, you can use the menu to view the following information:

  • Stats Info

  • FPS

  • Tracking Mode

  • Session Configurations

  • Debug Options

  • XR Origin

  • Planes

  • Anchors

  • Point Clouds

The AR Debug menu works with any scene that contains an ARSession, an XROrigin, and a Camera.

The Debug menu is a Prefab object containing the ARDebugMenu script and a set of GameObjects and components that provide the UI. See Setting up the menu for instructions to add the Debug menu to a scene.

Setting up the menu

To create an out-of-the-box fully configured debug menu, right-click anywhere in the Hierarchy window and select XR > AR Debug Menu.

The AR Debug menu appears as a toolbar that is anchored either to the left or bottom side of the screen.

Stats Info

The Stats Info tab provides general information about a session, including current FPS and TrackingMode.

Session Configurations

The Session Configurations tab displays all the available session Configurations for a specific platform and highlights the currently active configuration.

Debug Options

The Debug Options tab allows the user to toggle visualizers for various ARTrackables in the scene.

7 Likes

I have tested AR Foundation 5.0 before while still using stable ver 4.2.
It’s quite interesting to have many improvement, especially now it can simulate in Editor before compiling to real device.
Although to migrate the project, need to careful watch the changes, such as the XR Origin.
Overall, very nice.

I would like to ask two questions.

  1. As being said it needs at least Unity 2021 LTS, does it also affect the minimum requirement for real/mobile device?
    For example, for at least Android 14, but since AR Foundation 5.0, it will required …

  2. AR camera now has camera Y offset, which represent of user height.
    I read the script documentation that this feature will be useful for TrackingOriginMode = floor
    Does it affect if we use standard, or I think NotSpecified origin mode?
    I still confuse about this one…

Is meshing supported also by the Anrdoid/ARCore in the version 5.0? Previously this has only been supported for the iOS/ARKit.

EDIT: To answer my own question: No, there still is no support for meshing in ARCore XR Plugin 5.0 (Google ARCore XR Plug-in | Google ARCore XR Plugin | 5.0.7)

Is the support for meshing on AR Foundation roadmap?

ARCore itself doesn’t support meshing the way ARKit does, hence why it’s not supported. However depending on what you are trying to achieve you might find the depth image useful.

1 Like

@CiaranWills Thanks for the reply. But as the ARCore Depth API seems to enable (at least some sort of) meshing, I was wondering if AR Foundation would support meshing through AR Mesh Manager at some point. Or is this technically impossible?

Am I missing something? In Unity 2021.3.8, Version 4.2.3 is still the only available option via the package manager. Also the docs still only list 5.0.0-pre.13 as the latest release. Is this just an updated post about the old pre release? Or is there actually a new full release of ARFoundation 5.0 coming out and it is just not listed in the package manager yet?

1 Like

AR Foundation 4.2.3 is still the verified version for Unity 2021.3 (LTS). However, you can manually update the entry "com.unity.xr.arfoundation": "4.2.3" in the Packages/manifest.json file in your Unity project to point to the “5.0.0-pre.13” version of the package. You might need to update the versions for com.unity.xr.arcore and com.unity.xr.arkit packages as well.

AR Foundation 5.0 full-release is on the way and will be available in the package manager soon. Right now, 5.0.0-pre.13 is the latest publicly available version of the package.

1 Like

I see, thanks for the clarification @ankur-unity !

I found it a bit confusing that there was this new post and no mention that it was still referring to pre.13, which has been out for a while now.

I would like to also pass on my dislike for the change of hiding all the non verified versions completely. I know many other people have expressed this as well, but I do not see the point in hiding these things and making it harder for developers to use other versions.

Appreciate the work on the new features that are coming with AR Simulation etc though, very much looking forward to the full release!

1 Like

@Stents - Fair point. We could have been clear that at the time of writing this post, pre.13 is available and 5.0.0 is in QA, soon to be released. And thank you for all your feedback. I will pass your feedback about the package manager’s handling of non verified versions to the internal team at Unity.

I have good news, 5.0.2 is now available. AR Foundation samples have been updated to point to the 5.0.2 versions of the AR Foundation packages.

3 Likes

Our application uses the ConvertAsync(..) method of an XRCpuImage for getting the camera image data. Running the simulation in editor, it is reported that camera-image conversion is not supported. Without this it the simulation is not that helpful - (when) can we expect this to be implemented?

I have 2021.3.9f1 installed, and it does not let me choose ARFoundation 5.0.2 from the package manager, even if I enable pre-release packages.

1 Like

Yes, that’s on our roadmap - so you can expect it but I can’t give you a when right now.

Hi, I have unity LTS 2021.3.4f1 but I can install AR foundation 5.0.2. What should I do?

1 Like

@afurioso

We have a docs update coming soon that walks through this. The easiest way is to add the package by name: Unity - Manual: Install a UPM package by name

Package name is com.unity.xr.arfoundation.

Latest version at time of writing is 5.0.2, but you can always check the latest published version at this URL: Redirecting to latest version of com.unity.xr.arfoundation

I don’t see AR Foundation 5 in the package manager. I have pre-release packages enabled and am on 2021.3.x, which is higher than the minimum according to the docs. What is happening?

@JelmerV Thanks for asking as this is a common pain point. See my message above for how to access AR Foundation 5.0.2 in Unity 2021.3. At the time of writing, we are in the release process for 5.0.3, which includes a documentation update addressing this topic.

Ok, new reply (deleted the old one). I actually run into a bunch of problems:
Unity 2021.3.11: I added ARFoundation5 via the custom package manager way, described in your post. The result is a hot red glowing console, see attached image.
Unity 2022.1.22: I folllow the documentation that states “Thus, AR Foundation 5.0 appears in the Package Manager window in Unity 2022.x versions.”. Well, NO ARFoundation 5 in my package manager.

I’ve been using ARKit in Unity since 2017 and have been using ARKit plugin and later AR Foundation in many projects and it is pretty crazy that I am already using more than an hour (again) to try to get this to work. :face_with_spiral_eyes:

8585995--1150663--Screenshot 2022-11-14 at 21.42.56.png
8585995--1150666--Screenshot 2022-11-14 at 22.30.32.jpg

Hi @JelmerV

For your 2021.3 issue, make sure that you have the same version numbers installed for the following packages:

  • com.unity.xr.arfoundation
  • com.unity.xr.arkit
  • com.unity.xr.arcore

When upgrading to AR Foundation 5, you should remove the following packages as stated in step 4 of that new docs page:

  • com.unity.xr.arsubsystems // this assembly has been merged into AR Foundation in 5.0
  • com.unity.xr.arkit-face-tracking // this assembly has been merged into the ARKit package in 5.0

For more information see our Migration Guide.

Thanks for pointing out the error regarding our documentation of Unity 2022.1. You still need to manually add AR Foundation 5.0 to your manifest in that version. AR Foundation 5.0 is in “Released” status as of Unity 2022.2, so 2022.2 is the first Editor where it appears in the package manager, and we’ll update our docs to correctly reflect that.

2 Likes

Has anybody been having “wobbling” issues with iOS 16? By wobble I mean the object placement is anchored in place, but when you move the phone around there is a subtle wobble to it and it doesn’t have 100% stable placement.
Unity 2021.3.9f1
ARFoundation 5.1.0-pre2
ARKit XR Plugin 5.1.0-pre2