Search Unity

Question HoloLens 2 - Persist anchors with World Locking Tools

Discussion in 'AR' started by unity_WACr-zYRD1mvAQ, Mar 1, 2023.

  1. unity_WACr-zYRD1mvAQ

    unity_WACr-zYRD1mvAQ

    Joined:
    Feb 13, 2023
    Posts:
    1
    Hi !

    I am struggling to use the World Locking Tools correctly in my project with Unity 2021 for HoloLens 2.

    My project is basically configured with OpenXR from the MRTK (I followed the Set up a new OpenXR project with MRTK tutorial). Then, I have followed the steps of the Automated setup of World Locking Tools from the basic setup, and I added the development visualizers to see the anchors.

    All the options seems to be activated for persistence in my WorldLockingManager object : AutoSave and AutoLoad are checked (default config), with the XRSDK anchor subsystem. However, the anchors that appear when I walk around are not saved when I stop the game and re-run it.

    I added the Dashboard prefab from WLT-Samples so I can read the settings (auto save is well checked), but the info displays that "Can Save/Load" is false (means that AnchorManager.SupportsPersistence variable of the current instance manager is false). I don't understand what I'm doing wrong.

    I use :
    Unity version 2021.3.19
    WLT-Core version 1.5.9
    Mixed Reality OpenXR Plugin version 1.7.0

    I hope for an answer from someone more experienced than me, many thanks...
    Regards,

    Jinane
     
  2. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,062
  3. Martin_Th

    Martin_Th

    Joined:
    Aug 10, 2021
    Posts:
    3
    When you use the AnchorManagerXR you must change the line 225 or so from
    openXRPersistence = XRGeneralSettings.Instance.Manager.activeLoader.name.StartsWith("Open XR");

    to

    openXRPersistence = XRGeneralSettings.Instance.Manager.activeLoader.name.StartsWith("OpenXR");

    This is working for me