I’m reading the Gyroscope of my mobile phone and the results I’m getting are not consistent with what is supposed to.
The X axis of Input.gyro.attitude is working good, I use Input.gyro.attitude.eulerAngles.x and 0 degrees is the north no matter how tilted the phone is.
The problem is with the Y axis, that is supposed to be the tilt degrees, it varies the value if I move the X axis while keeping the same tilt.
I have been busy at this for days now and cannot find an explanation for this behavior.
This is because it is the EulerAngles representation of the rotation Quaternion which does not obey a normal degree rotation and will not always be what you expect even though they are correct for the rotation. I suggest you read a little up on Quaternions and how they work.
As a test: Have you tried rotating an object in your scene to match the rotation of the gyroscope, just to see if the rotation is correct? Example: transform.rotation = Input.gyro.attitute;