There is a difference in how ARWorldMap
loading/relocalization works on iOS 14 and 15, which is not mentioned in iOS 15 release notes.
Whenever you start an AR session by providing an initialWorldMap
and relocalization succeeds, on iOS 14 the AR world's origin is automatically updated to match the previously saved world's origin. However, on iOS 15 it's not.
In my case, I've used RealityKit for rendering and found out about it by creating an AnchorEntity()
(default identity transform) and adding it to my ARView
's scene after relocalization. On iOS 14, it is placed where the previously saved session started, as expected. While on iOS 15, it is placed exactly where the current session started.
It's not the case for the Apple's sample: Saving and Loading World Data, because the virtual object is restored using ARSessionDelegate
's method where a previously saved ARAnchor
is provided by the session. This is also the solution I use right now – to add an anchor before saving the world so you can use it later to e.g. update the world's origin using setWorldOrigin(relativeTransform:).
I'm sharing in case someone runs into this problem, and it'd be great if someone at Apple could confirm that's the desired behavior.
Hi, if there is a difference in how your app runs between iOS 14 and iOS 15 without you using new APIs, then please file this as a bug on Feedback Assistant. Post the feedback number here, and if this is indeed expected behavior, the feedback item will get sent back to you. Then you can update this post with that info. My guess is this is a bug, but file the bug so it can get routed to ARKit for confirmation.