Colocation and Shared Spatial Anchors result in wrong frame of reference
Hello everyone! I'm developing a networked experience using Unity 6 with Netcode for Gameobjects and the MetaXR SDK. I am trying to get Shared Spatial Anchors working using Colocation so that the players can see the same frame of reference in Mixed Reality. I managed to get Colocation and Shared Spatial Anchor sharing to work but when I try to align my player rig using the Shared Spatial Anchor from the host there is a misalignment in the scene. No obvious errors or warning are being thrown,I am using the code in the documentation as well as a video tutorial from "XR Dev Rob - Colocation with Meta’s Shared Spatial Anchors & the new Colocation Discovery API" as my main point of reference for my own code. Below is my alignment code if (await unboundAnchor.LocalizeAsync()) { Debug.Log($"Anchor localized successfully, UUID: {unboundAnchor.Uuid}"); var anchorGameObject = GameObject.Instantiate(_anchorPrefab); var spatialAnchor = anchorGameObject.GetOrAddComponent<OVRSpatialAnchor>(); anchorGameObject.name = $"Anchor_{unboundAnchor.Uuid}"; unboundAnchor.BindTo(spatialAnchor); _alignmentManager.AlignUserToAnchor(spatialAnchor); return; } With AlignUserToAnchor(OVRAnchor anchor public void AlignUserToAnchor(OVRSpatialAnchor anchor) { if (anchor == null || anchor.Localized == false) { Debug.LogError("Anchor is not localized yet."); return; } StartCoroutine(AlignmentCoroutine(anchor)); } private IEnumerator AlignmentCoroutine(OVRSpatialAnchor anchor) { var anchorTransform = anchor.transform; for (int alignmentCount = 2; alignmentCount > 0; alignmentCount--) { _cameraRigTransform.position = Vector3.zero; _cameraRigTransform.eulerAngles = Vector3.zero; yield return null; Vector3 offset = anchorTransform.InverseTransformPoint(Vector3.zero); Quaternion inverseYaw = Quaternion.Euler(0f, -anchorTransform.eulerAngles.y, 0f); _cameraRigTransform.position = offset; _cameraRigTransform.rotation = inverseYaw; Debug.Log($"Aligned camera rig position: {_cameraRigTransform.position}, rotation {_cameraRigTransform.eulerAngles}"); yield return new WaitForEndOfFrame(); } Debug.Log($"Alignment complete"); } } I am wondering if I am missing something that needs to be initialized to get the spatial data in order so that the Anchors can get localized correctly. Or if it is something else that I am missing. Thank you for your help! Kind regardsSolved90Views0likes1CommentIssues with Shared Spatial Anchors and Colocalization in Unity Editor
Hi, I'm experiencing problems with shared spatial anchors and colocalization in our Unity project using Quest 3 headsets. Specifically, when developing in the Unity Editor with test user accounts, the OVRSpatialAnchor.LoadUnboundAnchors method doesn't load any anchors under certain conditions—for example, when starting the Unity Editor before the Android application. Interestingly, if we build and run the Android application on two headsets, everything works fine on the devices themselves. Environment: Project Base: Custom project inspired by Photon Fusion Mixed Reality Local Multiplayer Unity Version: 2022.3.43f1 Meta XR All-in-One SDK Version: 68.0.1 Operating System: Windows 11 What I've Tried: Entitlements: Ensured that test users have inherited entitlements. Login: Logged in to the test user account under Meta > Platform > Edit Settings. Testing Combinations: Attempted various combinations of running the project in the Editor and as an Android application, starting them in different orders with varying results. Using only the Unity Editor instances doesn't seem to work at all. Colocation position sync occurs in the headset if the Android application is started before the Unity Editor. Logs: Reviewed logs for relevant errors and warnings but haven't found anything conclusive. Request for Assistance: Why might LoadUnboundAnchors not retrieve anchors when starting the Unity Editor before the Android application? Are there best practices for using test users with shared spatial anchors in this context? Any tips or guidance on resolving this issue would be greatly appreciated. Thanks for your help!795Views0likes1CommentIs it possible to test the Colocation Building Block functionality without a verified organization?
Hello Community, I have the following problem: I created an unity project with only the colocation building block (and all the dependent building blocks) and Auto Matchmaking Building Block. I also uploaded the apk into the dashboard, created a new channel and added three test users to the channel. On the two headsets I logged in with two different test users. But when the second headset tries to load the shared spatial anchor I get: "Failed to share the spatial anchor" error message on the first device. My fear is, that it is impossible (only for testing purpose) to build an Unity Application with Meta's Colocation Building Block without having a verfied organization in the Meta Quest Dashboard.Solved3.1KViews0likes1CommentIssue with Sharing Spatial Anchors in Meta XR SDK v. 66
Hello, I am encountering an issue with spatial anchors in my application using Meta XR SDK v. 66 on Quest 3. My application allows one user to create a spatial anchor and share it with other users in the session. However, the users who receive the shared spatial anchor are unable to share the same anchor using ShareAsync, despite successfully loading (LoadUnboundSharedAnchorsAsync) and saving (SaveAnchorsAsync) the anchor beforehand. Previously, with Meta XR SDK v. 60, I could do this without any issues by saving the anchor to the cloud before sharing using the now obsolete method: OVRSpatialAnchor.SaveOptions saveOptions; saveOptions.Storage = OVRSpace.StorageLocation.Cloud; _spatialAnchor.Save(saveOptions, (spatialAnchor, isSuccessful) => { ... }); Since updating to Meta XR SDK v. 66 and the latest Quest 3 software, and switching to the new async SSA methods, only the user who originally created the anchor can share it. For other users, the OVRSpatialAnchor.ShareAsync method fails with error code -1006. Here is a summary of the steps I am following: User A creates a spatial anchor and saves it using OVRSpatialAnchor.SaveAnchorsAsync. User A shares the anchor using OVRSpatialAnchor.ShareAsync. User B receives and successfully loads the shared anchor using OVRSpatialAnchor.LoadUnboundSharedAnchorsAsync. User B successfully saves the anchor using OVRSpatialAnchor.SaveAnchorsAsync. User B attempts to share the anchor but OVRSpatialAnchor.ShareAsync fails with error code -1006. I have verified that I am correctly adding the OVRSpaceUsers when sharing the anchors. The app has also been correctly configured on Oculus Developer Dashboard, and Share Point Cloud Data is enabled on all devices. Any guidance or solutions to resolve this issue would be greatly appreciated. Thank you!1.7KViews2likes3Comments