Forum Discussion
yutoVR
3 years agoProtege
OVRSpatialAnchor.Share() fails.
I'm testing Shared Spatial Anchors on Meta Quest Pro. The codes below. using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SpatialAnchorSender : MonoBehavio...
- 3 years ago
The problem has solved. Thank you loic-all!
https://github.com/oculus-samples/Unity-SharedSpatialAnchors/issues/4
- 3 years ago
FYI, this is the code that succeeds in Share().
using System.Collections; using System.Collections.Generic; using UnityEngine; using Oculus.Platform; public class SpatialAnchorSender : MonoBehaviour { void Start() { StartCoroutine(Share()); } IEnumerator Share() { var anchor = gameObject.AddComponent<OVRSpatialAnchor>(); yield return new WaitUntil(() => anchor.Created); var anchors = new HashSet<OVRSpatialAnchor> { anchor }; Core.Initialize(); Users.GetLoggedInUser().OnComplete(message => { var user = new OVRSpaceUser(message.GetUser().ID); var users = new HashSet<OVRSpaceUser> { user }; var saveOptions = new OVRSpatialAnchor.SaveOptions { Storage = OVRSpace.StorageLocation.Cloud }; OVRSpatialAnchor.Save(anchors, saveOptions, (collection, result) => { if (result is not OVRSpatialAnchor.OperationResult.Success) { Debug.LogError(result); return; } OVRSpatialAnchor.Share(collection, users, (collection, result) => { if (result is OVRSpatialAnchor.OperationResult.Success) { Debug.Log("Success sharing anchor."); } else { Debug.LogError(result); } }); }); }); } }
yutoVR
3 years agoProtege
The problem has solved. Thank you loic-all!
https://github.com/oculus-samples/Unity-SharedSpatialAnchors/issues/4
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 3 years ago