- Home /
Unity Oculus OVR not responding to remove/put on headset
I have this code:
OVRManager.HMDMounted += HandleHMDMounted;
OVRManager.HMDUnmounted += HandleHMDUnmounted;
Application.runInBackground = true;
In the Start
function of a script. The callbacks are simple logging functions
void HandleHMDMounted() { Debug.Log("ON"); }
void HandleHMDUnmounted() { Debug.Log("OFF"); }
The code does not run- I never see any logs despite putting it on/taking it off. Why?
My OVR version is 1.18.1, my Unity version is 2017.1.0f3
Answer by eovento · May 28, 2020 at 02:00 PM
I have a have absolutely the same problem. Did you find a solution for this? Thanks!
Answer by ltomov · Dec 17, 2021 at 05:55 PM
The reason none of these events get fired is that OVRManager must be added as a script to some GameObject.
I don't know if this is written anywhere, I had to browse the source code to figure it out - it has Awake(), Update(), etc. functions which handle this functionality and they don't get called unless the script is added to a GameObject.
Your answer

Follow this Question
Related Questions
Unity 3D with Oculus Rift? 2 Answers
Awesomium package + oculus package = nothing is working 1 Answer
add a "tablet" to a 3d space 1 Answer
Oculus Raycast jumping and off 2 Answers
Disable Oculus tracking 1 Answer