Hello everyone,
We make an application where we want to persist gameobjects in Unity with ARAnchors so that GameObjects stay on the same place between sessions of the application. We are building via UWP to the Hololens 2.
Problem: there is no documentaion on how to save and load (persist) ARAnchors between sessions. Official ARFoundation documenation only explains how to create and delete the anchors. Does anyone know how we can reach persistence for the anchors? any documentations oder tutorials? it feels like i have already searched the entire internet but most sites build on android or IOS or dont cover persistence.
Would be very thankful for every hint!
AR Foundation does not currently support persisting anchors across multiple sessions. You would need to use some sort of solution provided by Microsoft or a third party to enable this.
Sad to hear that…but thanks for the answer anyway!
We are in progress on developing an API for persistent anchors, but Microsoft owns and authors their AR Foundation provider for HoloLens. So once we release that API, Microsoft would then need to provide an implementation for it. Until then, best of luck with another solution!
Is there any news on those new APIs? In my case, I’m using meta quest. I know there is ARAnchorManager.TrySaveAnchorAsync, but is there a way to get the serialized anchors, so that I can send them, for example, to a server?
You can think of persistent anchors as a key value store. The SerializableGuid that you get back from TrySaveAnchorAsync is the key, and if you call TryLoadAnchorAsync with that key, you get the Anchor value back.
Meta’s runtime doesn’t explicitly specify this, but my understanding is that anchors are saved to your local device storage by default when you use the AR Foundation API. So you could send the serializable guid to a server, sure, but it’s only valid to be loaded by the same user of the same app on the same device. Meta has separate API’s for sharing the anchors with other users that we have not yet integrated. This is on our road map for next year!
Hope that helps.
Ok thanks. I’m now trying to integrate OVRSpatialAnchor in my existing app that uses ARFoundation, hoping that they will work well together.
Do you think there is a possibility to sponsor/fund this feature in ARFoundation to fast-track it and have it sooner?
If your company has a business relationship with Unity, you can discuss this with your account rep. Shared anchors is already one of our highest-priority tasks though, FYI.
Hello, I’m considering using ARFoundation with HoloLens 2 and Unity for an indoor navigation application, but I’m a bit confused. My doubts are:
- Is the anchors feature of ARFoundation useful for way-finding implementation with HoloLens 2?
- Do I need to code a pathfinding algorithm to connect the anchors?
- What does anchors persistence mean? Can I place anchors only once when developing the application and hold them in place at every use of the application after deployment on the device?
Thank you
Hello Andy,
is there any news on if this is going to be intregrated soon? as well as on the API for presistent anchors (and the implemenation for the Hololens)?
We shipped our persistent anchor API in AR Foundation 6.0 back in April 2024. Microsoft implements their own support package for AR Foundation. Any questions about HoloLens support for AR Foundation APIs should be directed to Microsoft.
Thanks Andy, I will ask Microsoft!