I spent way too many hours on this last night to no avail. It's probably super simple, but I have no programming skills whatsoever so I come to you guys for help.
Basically I found this code on the
Oculus Rift forums, and I think it's working (haven't tested it since I don't have a Rift at the moment) but I'm losing some much needed Playmaker support. Here's the script I'm using:
using UnityEngine;
using System.Collections;
public class riftdetector2 : MonoBehaviour {
public GameObject nonOVRCam;
public GameObject ovrRig;
private bool oculusActive = true;
void Update () {
if (oculusActive && !OVRManager.display.isPresent){
ovrRig.SetActive(false);
nonOVRCam.SetActive(true);
}
if (!oculusActive && OVRManager.display.isPresent){
nonOVRCam.SetActive(false);
ovrRig.SetActive(true);
}
oculusActive = OVRManager.display.isPresent;
}
}
Is there someway to turn this into a Playmaker action that works similarly to the Bool Test action? So that if there is a Rift detected it triggers a certain event, and vice versa? Again, sorry if it's a dumb question, I'm still grasping the basics of scripting, but any help would be really appreciated. Thanks!