How to implement Persistent Anchors in VisionPro

Can Persistent Anchors be implemented using Unity 2022.3.39, PolySpatial 1.3.1, and AR Foundation 5.1.5? I want a 3D model to be fixed in a specific location in the real world, even if the device is turned off. When reopening VisionPro, the model should still be in the same position as before

Hi!

Thanks for your feedback. Can you please submit this as an idea on the visionOS roadmap - that way we can begin to gauge interest in this feature against other feature requests.

Thank you!

Thank you for your response. I noticed that AR Foundation 6 has added support for Persistent Anchors, but it currently seems to be incompatible with VisionOS.

Have you ever tried to use ARAnchorManager and ARAnchor component with ARFoundation?

When I tried it on beginning of March, it works well.

There is similar thread below. so please check it :slight_smile:

Correct. Currently the AR Foundation persistent anchors API is only supported on Meta Quest, as documented here: Anchors platform support | AR Foundation | 6.0.3.

Thank you for your response. I have found some information that shows Persistent anchors in ARFoundation are not yet supported on VisionOS

Thank you for the response. Will the AR Foundation persistent anchors API support VisionOS in the future?

As @Cova_Graffity said, I use regular AnchorManager and ARAnchor components and they are already persistent across app sessions. When app starts, anchors created before are loaded into app automatically. (ARFoundation 5.1.5)

Hi, when you recenter in vision pro, will the position of anchors be changed? For example, long-press the digital crown to recenter, or open the app in different directions.

No anchors are attached to the real world surfaces. They are fixed to the initial point in real world as long as they are tracked well.

That’s awesome! Thank you.

ARKit itself doesn’t have a persistent storage API like some other AR platforms do. So the current AR Foundation Persistent Anchors API will not be supported on visionOS.

ARKit for iOS does have a feature called ARWorldMap that lets you persist your entire session state instead of individual anchors. We have a sample scene about this here: GitHub - Unity-Technologies/arfoundation-samples: Example content for Unity projects based on AR Foundation

I don’t believe ARKit for visionOS supports ARWorldMap though. I’m unaware of any way to persist anchors in visionOS via Apple API’s right now.

Do ARAnchorManager and ARAnchor work with Mixed Reality apps? I only got it to work with Fully Immersive apps. When building in Mixed Reality app, Xcode throws the following exception:

Cannot add ARAnchor. World Tracking Provider is null

Hey there! Sorry to hear your’e having trouble. ARAnchorManager should work as long as the Apple visionOS XR plugin loader is active. You should be able to Project Settings > XR Plug-in Management and ticking the box for Apple visionOS in the visionOS tab.

If that is set correctly, you may need to provide a world tracking usage description. I’m fairly certain the OS would block your app from running if this were the case, but to be sure you might want to double-check Project Settings > XR Plug-in Management > Apple visionOS and ensure that World Tracking Usage Description is set.

Finally, you should check Project Settings > XR Plug-in Management > Project Validation under the visionOS tab to ensure that no other issues are detected with your project settings. Your scene will need an ARSession as well, but that should be it in terms of set-up.

The package sample scene has a sample world anchor script which will place an anchor anywhere that you gaze/pinch, and update its position to the next gaze/pinch location. Does that work if you import the sample into your project and build to device? I should point out that ARKit features like world anchors don’t work in the visionOS simulator, so if you’re testing simulator builds, that result is expected.

If none of these solutions work for you, please submit a bug report with your project and steps to replicate the issue. Thanks for your patience and good luck!

Can you provide a VisionPro world anchor project project project on GitHub?

Unfortunately, we don’t have a project that we can share, but the sample scene in the com.unity.xr.visionos package shows how to use world anchors. Have you tried setting that up in a fresh Unity project? Please give that a try, and let us know what specific issues you’re running into.

1 Like

Gonna try that thanks

Hey there! Thanks for reaching out and sorry to hear you’re having trouble.

What you describe is the sample project :sweat_smile:

Can you please submit a bug report or a full log from Xcode? I’m not sure what’s going wrong here…