Forum Discussion
HedgehogTeam
10 years agoExplorer
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.
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
// Seems to be ok nly after the seond load of the scene
Thank you
Nicolas
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
4 Replies
Replies have been turned off for this discussion
- vrdavebOculus StaffThat's the right way to do it. What Unity version are you using?
- HedgehogTeamExplorerHi,
Unity 5.4.1 F1 - vrdavebOculus StaffI 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?
- HedgehogTeamExplorerYes 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
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 6 months ago
- 7 months ago
- 2 months ago