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. Dismiss Notice

Resolved XR Device Silmulator loses connection to XR Origin on scene change

Discussion in 'XR Interaction Toolkit and Input' started by gPerry, Jan 29, 2023.

  1. gPerry

    gPerry

    Joined:
    Nov 27, 2013
    Posts:
    21
    I'm not sure if this is the intended behaviour, but I think it is something that could be improved. I was testing a UI for a project, with a button to load the next scene on 'click'. Loading into the new scene, the XR Device Simulator lost its reference to the XR Origin from the first scene, and did not try to find it again in the new scene. I had to deactivate and reactivate the simulator game object for it to reconnect, which is not ideal.

    Rather than add the XR Device Simulator to the scene as a prefab, I enabled the 'Use XR Device Simulator in Scenes' option from Project Settings > XR Interaction Toolkit. I thought this would be better than individually adding it to every scene. However, as it is a persistent object via 'DontDestroyOnLoad', it does have this issue when changing scenes.

    Can it be updated to detect scene changes, or some other way of handling a lost reference to the XR Origin?
     
  2. chris-massie

    chris-massie

    Unity Technologies

    Joined:
    Jun 23, 2020
    Posts:
    220
    Thanks for reporting this. We have now fixed this in 2.3.0-pre.2 so the XR Device Simulator will attempt to find the new main camera if the old one is disabled or destroyed. That version will be released soon.
     
    gPerry likes this.