UnityRef is currently in early development. Some features may be incomplete and/or not functioning.

UNITYREF

Your Pit Stop For Solving ANYTHING in Unity

architecture

XR Origin Desync on Scene Change

Under Audit

virtual realitymemory managementvr development

Unity 6.3.x - Unity 6.3.x

Published 6 days ago

When transitioning between scenes using SceneManager.LoadScene(), the Main Camera and your controllers may not reliably spawn at the new scene's XR Origin location, retaining their previous global position.

Issue

 When transitioning between scenes using SceneManager.LoadScene(), the Main Camera and your controllers may not spawn at the designated XR Origin location in the new scene. Instead, these objects retain their global position from the previous scene, even if the XR Origin in the target scene is placed at 0, 0, 0. This behavior is observed when XR Origin objects are copied from a VR template scene into new scenes. Investigations into the XR Origin components and attempts to modify GameObject transforms in scene loading scripts have not resolved the issue. Specific configurations include disabling far interaction in the Near-Far Interactor component of the XR Origin prefab and adding a Tracked Pose Driver (though currently disabled). The problem has been observed when testing within the Unity editor using XR Interaction Simulator.

Experimental Fixes
  • Ensure that the Main Camera and any tracked controllers are direct children of the **XR Origin**.
  • Manually reset the Transform.position of the Main Camera and your controllers to match the **XR Origin**’s position after the scene has fully loaded.
  • Verify that no GameObject with the **XR Origin** or its critical children has DontDestroyOnLoad applied, which would prevent its destruction and proper re-initialization in the new scene.

Editor's Note:

The above fixes have not been verified by our audit team yet. They are provided exclusively for your own technical research. We recommend creating a backup of your project before proceeding with any attempts. Utilize at your own discretion!

Related Posts Haven't quite found a solution to your problem? We think these posts might help you.

Content inspired by a Unity discussion post.