- Home /
How can I get the phone orientation?
I need to know the phone orientation of the phone , but only the axis in the plane of the screen. I don't need the axis perpendicular to the screen (Z). attitude gives the global orientation, but if I extract euler angles from here they are affected by the Z axis orientation.
I only need X and Y angles referenced to the horizontal.
How can I achieve this? Any operation with the quaternion to change the reference?
Thanks in advance.
Answer by ManuelJOrtega · Oct 02, 2017 at 04:21 PM
Thanks thothoww. I think this is the way, but like I said before, input.gyro.attitude is a global orientation and I need the orientation referenced to the horizontal. I made some test measuring the euler x,y,z from attitude and when you turn the phone in the z axis, the x and y euler angles are also affected.
Answer by LaurynasLubys · Jul 18, 2021 at 11:00 AM
Hey ManuelJOrtega, have you ever found a solution to this? I also need exactly this (but also without bias of forces).
Your answer
![](https://koobas.hobune.stream/wayback/20220612140120im_/https://answers.unity.com/themes/thub/images/avi.jpg)