Skip to main content
Up and Coming
October 15, 2016

OVRManager.HMDUnmounted event seems to not work correctly

Hi,

I use OVRManager.HMDUnmounted to detect that the player removes the GEAR, to stop reading the video and bring up a menu.

But the operation remains strange, I have two scenes the main menu and the player. When the scene "player" is loaded for the first time the detection is never performed, I need to go back to main menu and reload the player scene. 

From the moment that the scene was load 2 times the event is correctly received, and the video stops as desired,  but all SetActive commande are not taken into account ...

Is there another method to detect the player removes the Gear VR ?

Here my code

void OnEnable(){
  OVRManager.HMDUnmounted += OVRManager_HMDUnmounted;
}

void OnDisable(){
  OVRManager.HMDUnmounted -= OVRManager_HMDUnmounted;
}

// Seems to be ok nly after the seond load of the scene
void OVRManager_HMDUnmounted (){
  mediaCtrl.Pause();                       // OK after the second load
  VRCameraUI.SetActive( true);     // Not take into account
  reticule.SetActive( true);                // Not take into account
  playerMenu.SetActive( true);        // Not take into account
}


Thank you

Nicolas

    This topic has been closed for replies.

    4 replies

    Inspiring
    October 15, 2016
    That's the right way to do it. What Unity version are you using?
    Up and Coming
    October 15, 2016
    Hi,

    Unity 5.4.1 F1
    Inspiring
    October 17, 2016
    I just wrote a very similar script and the HMDUnmounted event fired as expected. It won't fire if you're in developer mode. Can you make sure that isn't enabled?
    Up and Coming
    October 17, 2016
    Yes it isn't. 
    I will remove this functionality I've already spent too much time on this, but this may be related to video playback plugins that I use...

    Thank you