05-20-2013 02:39 PM
05-20-2013 03:38 PM
05-20-2013 03:49 PM
05-20-2013 04:44 PM
05-21-2013 02:34 PM
08-04-2013 07:20 PM
if (Input.GetKeyDown("left ctrl"))
{
OVRDevice.ResetOrientation(0);
}
08-05-2013 01:24 AM
10-26-2013 04:07 PM
Assets/Dolly.js(32,17): BCE0005: Unknown identifier: 'OVRDevice'.
11-23-2013 01:28 PM
"bwiklund" wrote:
I get this error:Assets/Dolly.js(32,17): BCE0005: Unknown identifier: 'OVRDevice'.
What's the right way to get the reference to OVRDevice inside a script?
11-23-2013 02:03 PM
private OVRDevice ovrdevice ; // This is the variable you'll use to reference the OVRDevice script.
void Awake()
{
ovrdevice = GameObject.Find(OVRController).GetComponent<OVRDevice>() ; // Here, we reference the script OVRDevice, attached to the gameobject OVRController, in our variable ovrdevice.
}
void Update()
{
if (Input.GetKeyDown("left ctrl")) // If the player press left ctrl (listed as an imput in Unity in the inputs window)...
{
ovrdevice.ResetOrientation(0); // ... we call the ResetOrientation() function of the OVRDevice script referenced in our ovrdevice variable.
}
}