Hello, I have the following code snippet in a Unity application that used DK1: Code (csharp): if ( OVRDevice.IsInitialized() && OVRDevice.IsSensorPresent() && OVRDevice.IsHMDPresent() ) { print( OVRDevice.IsSensorPresent() ); oculusPresent = true; standardController.SetActive( false ); sounds.TheController = oculusController.GetComponent<CharacterController>(); transform.parent = oculusController.transform; } Now that I am migrating the app to use DK2, of course I am first replacing all references to OVRDevice with OVRManager, but I wonder what would be the best way of updating this block of code, because there is the boolean variable ovrIsInitialized and the method OVR_Initialize() and a few other things... I am going through the OVRManager file, but as a beginner, I find it a bit difficult to figure out how to do this in a succinct manner. I did notice though the HMDAcquired() method, so I tried to simply replace the first line of the old code with the following: Code (csharp): if ( OVRManager.HMDAcquired() ) However, I get an error message that reads: error CS0070: The event 'OVRManager.HMDAcquired' can only appear on the left hand side of += or -= when used outside of the type 'OVRManager' What am I doing wrong with HMDAcquired() and how can I re-write the old code using the new DK2 functions in an elegant way? Thank you,
HMDAcquired() is not a function, its an event so thats why you cant use it like that. You can use OVRManager.display.isPresent to detect if a display are connected and OVRManager.tracker.isPresent to check if a tracker are connected.
* Thank you! I now see what I was doing wrong... I do, however, not get anything in return when I use the following code in my Start() though: Code (CSharp): if ( OVRManager.display.isPresent && OVRManager.tracker.isPresent ) Debug.Log ( "Both display and tracker are present!" ); But when I use the following, it works: Code (CSharp): if ( Ovr.Hmd.Detect() > 0 ) Debug.Log ( "Rift detected!" ); Have you had this problem before? *