Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Question Recenter isn't working on the latest XR Interaction toolkit 2.3.2\2.4.0?

Discussion in 'XR Interaction Toolkit and Input' started by kfireven, Jun 21, 2023.

  1. kfireven

    kfireven

    Joined:
    Oct 18, 2016
    Posts:
    38
    Using the latest XR toolkit with OpenXR on the Meta Quest 2, when trying to do recenter with holding the Oculus/home button on the right controller or via hand tracking the player position/rotation doesn't change, it does work on my other project which is built with the XR toolkit 2.3.0... is it broken on the latest 2.3.2\2.4.0? can someone confirm, or am I missing something in my setup?
     
  2. Radicals270

    Radicals270

    Joined:
    Jun 14, 2020
    Posts:
    13
    Having the same problem too, sorry to not have a solution though....
     
  3. Radicals270

    Radicals270

    Joined:
    Jun 14, 2020
    Posts:
    13
    Good news! We seem to have solved this.

    Backstory/investigation:

    We noticed that re-centering WAS working on our project earlier in the month, then suddenly stopped working. We narrowed down the culprit commit, which had modified the file:
    Assets\XR\XRGeneralSettings.asset
    (Note that no-one manually changed this file, we have no idea what triggered the change.)

    The only thing that had changed was a reference for the entry:
    "m_Name: Android Providers", whose "m_Loaders: <GUID>" referenced GUID had changed... When I looked up what asset that GUID was, it turns out that it had swapped from the (working) "Oculus Loader.asset" to the (broken) "Open XR Loader.asset". When I manually edited the XRGeneralSettings.asset file to reference the previously working Oculus Loader.asset, it worked again.

    TL;DR/Solution:
    Investigate the file:
    Assets\XR\XRGeneralSettings.asset
    Check the entry under: "m_Name: Android Providers". Ensure that the GUID it has for it's "m_Loaders: <GUID>" is referring to the "Oculus Loader.asset" and not the "Open XR Loader.asset". There are plenty of tools online to find the GUID of assets such as:
    https://docs.unity3d.com/ScriptReference/AssetDatabase.AssetPathToGUID.html

    Hope this helps someone.
     
  4. ericprovencher

    ericprovencher

    Unity Technologies

    Joined:
    Dec 17, 2020
    Posts:
    156
    Recentering isn’t supported in OpenXR for stage mode tracking, which xri defaults to because it sets the floor to the correct height. It does work with device mode tracking, but that centers everything to your view.

    We’re working on a workaround to this so that stage mode will behave like floor mode, but it won’t be available until the next release of the OpenXR package.

    This is something that’s missing from the OpenXR spec unfortunately. Last I checked meta has an extension proposal to support it, but it has not yet been ratified.