hi all, I am starting my first project and I am going to make a marble game that uses the gyroscope on the device. I used the simple bit of code (http://docs.unity3d.com/ScriptReference/Gyroscope-attitude.html) on a GameObject and it works on my android via unity remote. Now when I start the project, the object always starts on a slant (the device is level ground) and I would like it do start level to the device/camera. Can somebody please point me in the right direction on how to sort this out please. I am new to all this and would like one or two pointers.
How much of a slant? Is it like 90 degrees, or just a slight one? Gyroscopes are not necessarily perfectly accurate so you might get a slight slant even when lying flat. You could try doing some kind of deadzone, so you need to rotate beyond a certain amount before your object reacts. You can also try to calibrate it, by storing the initial rotation and designating this as zero.
This is good gyro example (with demo project), maybe can get some ideas: http://blog.heyworks.com/how-to-write-gyroscope-controller-with-unity3d/