Using persistent WorldAnchors on GameObjects spawned in runtime?

Hello, I’m building an application for Hololens 2 with MRTK where the user can select a gameobject to then place a copy of it in space. The objects need to stay in place between sessions and after rebooting the device, so I started using WorldAnchors for that purpose.

If the objects are unique and are already placed in the scene, the Transform properties are retrieved correctly when the session is restarted. However, as gameobjects are copied and Instantiated in runtime, I save the type of gameobject and anchor name on a binary file, to then later retrieve it. This time, the correct gameobjects are instantiated but they aren’t correctly placed, even though they seem to be anchored, as the app does not let you move them. Anyone has managed to achieve this?

What version of Unity are you using? Are you using Legacy XR or the new XR SDK plug in system?

Thanks, but I finally solved it! The problem was the serialization of the Anchor’s name. When I deserialized it, it didn’t return the exact same string, so it wasn’t saving the anchor correctly

Awesome, glad you figured it out!

I tried using ReSight SDK, worked quite well