Meta Quest Spatial Anchors | Create, Save, Erase & Load spatial anchors
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
Very nice video, I would love to see one on Shared Spatial Anchors!
Thank you, I'm exciting for what you could come up with shared spatial anchor tutorial.
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.
Thank you for your suggestion!
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?
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
why do i get this error in step 2:
[OVRSpatialAnchor] OVRPlugin.CreateSpatialAnchor failed. Destroying OVRSpatialAnchor component.
UnityEngine.Debug:LogError (object)
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?
Now Meta says LoadUnboundAnchors is obsolete, and to use the Async version of that method instead
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
I am getting the same thing too. Did you figure out why?
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()
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?
Check if you enabled spatial data over meta link in your meta link app's beta features!
mruk is now depricated what should we use instead? i am unable to find the MRUK prefab...
MRUK is not at all deprecated. It has slightly changed but is now better than ever.
should it work in editor?
Yes!
@@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.