I would like to get a reference to Gyroscope
and retreive its rotationRate
.
Using code like this:
...
void Start() {
if (SystemInfo.supportsGyroscope) {
gyro = Input.gyro;
gyro.enabled = true;
}
}
void Update() {
if (gyro.enabled) {
Debug.Log("Gyro: " + gyro.rotationRate);
}
}
...
The problem is that SystemInfo.supportsGyroscope
returns false. gyro.enabled = true;
doesn’t do the trick, since Gyroscope.attitude
keeps returning (0, 0, 0) object.
I am using Unity v5 along with Unity Remote 4, and have Dell Venue 7 connected for quick debugging. Everything worked fine just 2 weeks ago with Unity v4. Now, after upgrade it stopped working.