In AR with Meta Quest 3, when referenceSpaceType
is set to 'unbounded'
and the anchorSystem.addAnchorAtPositionAndRotationAsync
function is used, it throws an error:
“Error creating anchor: OperationError Failed to execute ‘createAnchor’ on ‘XRFrame’: Anchor creation failed”
This issue was briefly mentioned back in a 2021 thread:
The problem still exists. To get anchors working in AR, we have to enable a boundary using "local-floor"
but that’s not ideal. The boundary is really meant for VR, not AR, and feels like an unnecessary restriction. Anchors are mainly for AR and should work without it.
Here’s a full reproduction playground:
WebXR Anchor in AR problem | Babylon.js Playground
Can you trace the bug enough to see whether it’s caused by the WebXR API itself or something in Babylon?
It’s interesting that the error doesn’t happen when using hit test. If the anchor is created with anchorSystem.addAnchorPointUsingHitTestResultAsync
, it works fine with 'unbounded'
.
Here’s a modified playground using 'unbounded'
and hit test:
WebXR measurement tape | Babylon.js Playground
What’s the key difference between addAnchorAtPositionAndRotationAsync
and addAnchorPointUsingHitTestResultAsync
that causes this error?
Thank you!