- Home /
Gyro.Attitude and Device Orientation issues?
Hi, I am making a gyro controller, it is working fine except that when the device changes orientation all the axis get messed up like so:
The rotation I get back from Input.gyro.attitude
switches the x-axis and the y-axis around (or make them negative if you hold device upside down), even though I locked the Screen Orientation in player settings. As an extra nuisance, the device orientation on startup will also influence the way the axis are orientated. Is there an easy way to keep the axis fixed?
Answer by Jwizard93 · Jul 11, 2017 at 04:11 AM
Don't use that variable to set the orientation of anything in your game then, instead use it to know if you need to correct and in what way you need to correct the output of the gyro to match the orientation you want.
Guarantee you someone has done it and put it out there. Sounds like a good exercise for a roll-your-own though.
Your answer
Follow this Question
Related Questions
Input.gyro.attitude returns zero value 1 Answer
I would like to know if with a unity free is possible to use gyroscope android? 1 Answer
Gyroscope affected by device Rotation 0 Answers
How to transform local space to world GYRO space on ios? 0 Answers
Unity 3.4 Gyroscope support not there? 2 Answers