- Home /
Why does my accelerometer stop working after I add google cardboard?
I'm developing my 2nd android app for Google Cardboard and I need to access the accelerometer(the x axis specifically). According to multiple sources, the way to get the acceleration is Input.acceleration
(a Vector3 in case you didn't know). I made a test game where i just read the accelerometer and put the vector into a GUI. the values showed up as expected, but when I did the exact same thing on my real game, the whole vector was (0,0,0). I did some more testing and I have reached the conclusion that the google cardboard extension was messing up the accelerometer. How can I use Input.acceleration
when I have my google cardboard library in?
One last thing: At the bottom of my Unity window It says "Unable to find activity in manifest. You need to make sure orientation attribute is set to fullSensor manually."
Answer by dolims · Jan 05, 2015 at 11:03 PM
It's a bug in the Google Cardboard SDK. Both orientation and accelerometer inputs are currently broken when using the Cardboard SDK. Hopefully will be fixed ASAP.
The activity/manifest message is unrelated. For a fix, see http://stackoverflow.com/a/27587358/4372377
Update for Unity 5: Sensors appear to work when using the Cardboard SDK.