The question is answered, right answer was accepted
Making 2D Compass From Quaternion
I have a 3D rotation (Quaternion) of a device from Input.compass.rawVector
and want a 2D rotation (Vector2) of the device in X and Z axis. The given Quaternion is not always looking at the horizon - the Y value varies. How do you take such a Quaternion value and calculate a 2D rotation in the XZ face?
Answer by X10KND · Nov 21, 2016 at 03:53 PM
I did quite get your question but try this. (I'm answering from mobile device. Forgive me if it is hard to read)
Vector2 compass_vector;
compass_vector = new Vector2 (Quaternion.Euler(Input.compass.rawVector).x, Quaternion.Euler(Input.compass.rawVector).z);
Let me know.
Hi X10$$anonymous$$ND, I apologize my late reply - I managed to solve this problem by installing a script and tracking the Euler angles' Y value. Thank you for your answer though!
Follow this Question
Related Questions
How to find a position's angle around an arbitrary axis? 1 Answer
How can I work out the orientation of my rotatable cube via script? 1 Answer
Make camera have same rotation but with an offset 0 Answers
Help with suns rotation 0 Answers
Rotate clockwise/counterclockwise using Quaternion.Slerp() 0 Answers