Hi
I’m making a game that can be played with both iOS and Android devices and the gyrescope is an important part af that game.
When a button is pushed I lock the current orientation of the device like this:
// Lock gyro-coordinates gyrXLocked = Input.gyro.attitude.x; gyrYLocked = Input.gyro.attitude.y; gyrZLocked = Input.gyro.attitude.z;
Afterwards I have a light that lights up every time the device has this sepcific orientation (+/- a float value).
It works perfect on iOS but on Android the light seems to light up kind of random and the orientation where the light lights up seems to be changing over time. Sometimes it seems to be affected by the physical position in the world and not the device orientation.
I have searched the web and found several posts saying gyroscope doesn’t work on android. Though, these posts have been 2-3 years old so I would think a gyroscope would be implemented in most android devices by now!?
Others have found a solution by using the accelerometer instead, but since I have to use a specific orientation that stays the same over time, that wouldn’t work for me…
Does anyone know why the gyrescope is working differently on iOS and Andriod - and more importantly - does anyone have a solution to my problem?
Thanks
/Moeskjaer