Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
Viconthebeach's avatar
3 years ago

Getting error when saving OVRSpatialAnchor to local

Can't save anchors to local. It works with the sample scene "SpatialAnchor" but not from my project.

Getting error:

OVRPlugin.SaveSpaceList failed with error Failure_OperationFailed

 

None of my debug lines below are fired, the error is fired from the OVRPlugin.

Is there any special authorization access to local storage or headset space access to allow somewhere in manifest or build settings? 

 

public void SaveAnchor()
{
 if (!_spatialAnchor)
 {
   var debugString = "No OVRSpatialAnchor found";
   AnchorUIManager.Instance.debugTextBox.text = debugString;
   return;
  }
  _spatialAnchor.Save((anchor, success) =>
  {
      if (!success)
      {
          var debugString2 = "Spatial anchor coudn't be saved.";
          AnchorUIManager.Instance.debugTextBox.text = debugString2;
          return;
      }
          var debugString = "Spatial anchor saved, now saving to playerPrefs...";
          AnchorUIManager.Instance.debugTextBox.text = debugString;
          SaveUuidToPlayerPrefs(anchor.Uuid);
  });
 }
}

 

 

3 Replies

Replies have been turned off for this discussion
  • Found this post because I ran into the same errors this morning. You probably resolved it after a week but I'll just mention that you can get this error if you try to save the new OVRSpatialAnchor object immediately after creating it. The creation process is asynchronous - it's mentioned in the docs that the uuid is not immediately valid - but they don't seem to describe any callback process. 

    My use case is the user positions a grabbable object in the scene and then saves that position as a new anchor. So, what I'm doing now is after instantiating a new object with the OVRSpatialAnchor, call a coroutine that waits for newAnchor.Localized == true before attempting the save.  I might try looking again to see if there's a way to get a newly created instance to trigger a callback.

  • sabintm's avatar
    sabintm
    Honored Guest

    Same problem. I can load anchors, but not save them.