Search Unity

Bug Move XROrigin and the camera drifts from parent

Discussion in 'VR' started by Murray_Zutari, Apr 5, 2022.

  1. Murray_Zutari

    Murray_Zutari

    Joined:
    Jun 1, 2017
    Posts:
    45
    If I generate a XR Origin (action-based) it spawns at world zero. If I try move it to another position, the camera drifts but its transform still reads that it's at 0,0,0 in relation to its parent the Camera Offset, which also reads 0,0,0 in relation to the XR Origin parent.

    Using OpenXR 1.3.1, v2021.2.15f

    EDIT: I tested this in a version of 2020.3 and it also happens. However, it only happens once I install the Interaction Toolkit v2.

    upload_2022-4-5_11-4-35.png
     
    Last edited: Apr 5, 2022
    DevronDJ and JPTAR like this.
  2. DaveRed52

    DaveRed52

    Joined:
    Jan 7, 2023
    Posts:
    4
    Hi Murray, Did you ever manage to figure this out? I am having this issue also in 2021.3.16f, I have tried rebuilding the Origin from scratch, making new projects and many other fixes and nothing seems to work for me.
     
  3. VRDave_Unity

    VRDave_Unity

    Unity Technologies

    Joined:
    Nov 19, 2021
    Posts:
    275
    Hey @DaveRed52 and @Murray_Zutari,
    Can you tell me how you are moving the origin? I saw the XR Interaction Toolkit mentioned, so I would like to understand if this is from teleporting or is there another mechanism for movement?
     
  4. jaschott

    jaschott

    Joined:
    Dec 6, 2021
    Posts:
    3
    I think he is referring to just moving the XR origin in the scene using the handles.
     
  5. JPTAR

    JPTAR

    Joined:
    May 16, 2022
    Posts:
    3
    I am also having this issue, it appears that whenever the origin is moved, the camera is moved twice. For example, moving the origin to 24,0,643 results in the camera being displaced from the origin. However, if the camera is given the local coordinates of -24,0,-643 then the camera and origin align perfectly. I realize this doesn't answer your question, but I hope it will help contribute to a solution.
     
  6. Sangsterrow

    Sangsterrow

    Joined:
    Apr 21, 2023
    Posts:
    1
    Is there any news on potential fixes for this issue? It's making developing for VR and XR devices more difficult than it should be.
     
  7. ayrasci

    ayrasci

    Joined:
    Jun 19, 2023
    Posts:
    1
    This just happened to me as well using OpenXR plugin 1.7 in Unity 2022.3. I can't get the main camera and XR Origin to be in the same place no matter how hard I try.

    Any time I attempt to move the XR Origin or the camera in the scene tab, the other is moved at the same time, so I can't manually reposition them together. When I first tried to move it, I selected the entire XR Origin from the hierarchy, then placed it where I needed it only to find the camera had move off in the void outside my project.

    I also tried selecting both and setting them to the same coordinates, but that didn't help. They say they are in the same place, but they're lying. XD

    UPDATE: Removing the XR Origin from the scene and adding a new one just added a new pre-separated XR Origin from Camera. Creating a new scene and adding the XR Origin worked correctly. My solution, just lower my terrain height for now. Hope this is still being looked into.

    camera.png
    xrorigin.png
     
    Last edited: Jul 10, 2023
  8. DevronDJ

    DevronDJ

    Joined:
    Sep 8, 2022
    Posts:
    3
    I'm struggling with this too. Main camera becomes detached from origin when moving it around in the editor. Any help would be awesome if anyone figures it out, thanks.
     
  9. JustAruss

    JustAruss

    Joined:
    May 16, 2019
    Posts:
    3
    Umm anybody help? Any dev or someone? I have the same issue
     

    Attached Files:

  10. JustAruss

    JustAruss

    Joined:
    May 16, 2019
    Posts:
    3
  11. DevronDJ

    DevronDJ

    Joined:
    Sep 8, 2022
    Posts:
    3
    I found the answer in another thread: at the top left of the scene window, click the drop down and select "Pivot" instead of "Center" when you move the XR Origin. Super simple but weird, and I'd never have thought of it without help.

    Screenshot 2023-08-25 at 16.38.43.png
     
  12. ReadyVR_Official

    ReadyVR_Official

    Joined:
    Jan 14, 2022
    Posts:
    2
    Life saver, this should be pinned on top!