Meta Quest Spatial Anchors | Create, Save, Erase & Load spatial anchors

Sdílet
Vložit
  • čas přidán 16. 07. 2024
  • Hi XR developer! In previous videos we learned how to use mixed reality features such as passthrough, scene understanding and environment occlusion. We also looked at several ways on how to place objects in our room. Now, what if we would like to place our objects consistently in our scene and be able to load them again in the exact same position? This is where we need Meta’s spatial anchors, which we are going to look at today. We will look at how to create, save and load spatial anchors locally on our device.
    Resources:
    🔗 Spatial Anchors Documentation: developer.oculus.com/document...
    🔗 Use Shared Spatial Anchors: developer.oculus.com/document...
    Other Videos:
    📹 Mixed Reality Utility Kit: Build spatially-aware apps with Meta XR SDK: • Mixed Reality Utility ...
    📹 Meta’s Building Blocks | Develop Mixed Reality Apps lightning fast: • Meta’s Building Blocks...
    📹 How to use Lights & Shadows in Passthrough Mode: • How to use Lights & Sh...
    📹 Get Started with Meta Quest Development in Unity: • Get Started with Meta ...
    📹 Meta Quest Scene API: • Meta Quest Scene API |...
    📹 Meta Quest Depth API and Occlusion Shaders: • Meta Quest Depth API a...
    Join the Discord!
    👾 / discord
    Support the Channel:
    🫂 Patreon: / blackwhalestudio
    🐦 Twitter: / xrdevrob
    🤝 Join this channel to get access to perks:
    / @blackwhalestudio
    Need professional XR & Multiplayer development for your project?
    👨‍💻 Get in touch with us: bento.me/blackwhale
    Chapters:
    0:00 Intro
    0:48 Project & Scene Setup
    1:29 Create Spatial Anchors
    2:44 Get UUID of Spatial Anchor after creation
    5:08 Save & Unsave Spatial Anchors
    7:05 Unsave (or Save) all Spatial Anchors at once
    8:43 Load all previously saved Spatial Anchors
    12:46 Use MRUK to place anchors on the wall!
    14:38 Outro

Komentáře • 22

  • @mattpatterson8237
    @mattpatterson8237 Před 2 měsíci +3

    Very nice video, I would love to see one on Shared Spatial Anchors!

  • @Kingdomax
    @Kingdomax Před 4 měsíci +2

    Thank you, I'm exciting for what you could come up with shared spatial anchor tutorial.

  • @marcelrebolledo9414
    @marcelrebolledo9414 Před 3 měsíci +2

    Creating a video that showcases how to use "Shared Spatial Anchors" with Netcode for GameObjects 1.8.1 in a Unity project could be an excellent resource for developers looking to implement multiplayer features with a focus on AR (Augmented Reality) experiences.

  • @Doflamingo133
    @Doflamingo133 Před měsícem +1

    Hey quick question if you see it and I am lucky. The spatial anchors work in editor but not in the build. Do you know why this could be happening?

  • @kimfaiyim
    @kimfaiyim Před 9 dny

    This is a great video! Thank you! However, there is something update in the SDK and somehow I can't get the pose of the anchor. I get error like " Anchor must be localized before obtaining its pose" from the code "var pose = unboundAnchor.Pose;". Could anyone give me some help on this problem

  • @user-ed3lj4le1x
    @user-ed3lj4le1x Před 23 dny

    why do i get this error in step 2:
    [OVRSpatialAnchor] OVRPlugin.CreateSpatialAnchor failed. Destroying OVRSpatialAnchor component.
    UnityEngine.Debug:LogError (object)

  • @strangefuture
    @strangefuture Před 2 měsíci

    Could we in theory use this logic to save a game scene on a wall/floor or table of the players choosing, and then be able to play the game after the anchor is placed?

  • @citan554
    @citan554 Před 3 měsíci +1

    Now Meta says LoadUnboundAnchors is obsolete, and to use the Async version of that method instead

  • @CozyRelaxingAmbience365
    @CozyRelaxingAmbience365 Před 4 měsíci +2

    Hello, thank you for your video, I follow the steps and created anchors, but I always got success=false in OVRSpatialAnchor.Save callback function. Donot know why

    • @stevenle8969
      @stevenle8969 Před 3 měsíci

      I am getting the same thing too. Did you figure out why?

  • @coverscollection8775
    @coverscollection8775 Před 2 měsíci

    I cant save the anchor
    15:57:05.350
    Unity
    [OVRSpatialAnchor] OVRPlugin.SaveSpaceList failed with error Failure_InvalidOperation.
    15:57:05.350
    Unity
    OVRSpatialAnchor:Save(ICollection`1, SaveOptions, Action`2)
    15:57:05.350
    Unity
    OVRSpatialAnchor:SaveBatchAnchors()
    15:57:05.350
    Unity
    OVRSpatialAnchor:LateUpdate()

  • @McYvar
    @McYvar Před 4 měsíci

    Ayo! How did you get the spatial anchor creating working in Unity itself? Each time, when the prefab is instantiated, the OVRSpatialAnchor script tries to create the anchor but fails to do so even though it does work on a build in the headset itself. So how exactly did you manage that?

    • @blackwhalestudio
      @blackwhalestudio  Před 4 měsíci

      Check if you enabled spatial data over meta link in your meta link app's beta features!

  • @user-rn6mv9xw4d
    @user-rn6mv9xw4d Před měsícem

    mruk is now depricated what should we use instead? i am unable to find the MRUK prefab...

    • @blackwhalestudio
      @blackwhalestudio  Před měsícem

      MRUK is not at all deprecated. It has slightly changed but is now better than ever.

  • @TheGameLecturer
    @TheGameLecturer Před 4 měsíci

    should it work in editor?

    • @blackwhalestudio
      @blackwhalestudio  Před 4 měsíci +1

      Yes!

    • @TheGameLecturer
      @TheGameLecturer Před 4 měsíci

      @@blackwhalestudio Thanks for the answerer, for some reason it doesn't work for me right now but knowing it should work in editor might help the debugging process.