Question by
MGlolenstine · Dec 04, 2018 at 02:40 PM ·
camerarotationgyroscope
Problems with gyro camera rotation.
I want to rotate camera in the game, just as I am moving the phone(Just like VR does it).
for that I'm currently using this piece of code
cam.transform.Rotate(-gyro.rotationRate[0], -gyro.rotationRate[1], gyro.rotationRate[2]);
but it doesn't really do the job. When I try the app out via Unity Remote(this could actually be the problem), and if my phone was perfectly flat on the table, I fidget with it and return it back to the same position as it was in before, camera is still rotated and/tilted. It's just like I'm losing some of the information that the gyro should be sending.
Is there something I'm doing wrong and/or would be better done with something else?
Thanks!
EDIT: Just tested... UnityRemote is not the problem.
Comment