(Wrote an incorrect title btw…)
I’ve been trying to read the rotation around the Y axis using the same method as Unity’s TiltControls in the standard assets which reads from the accelerometer. This seems to only work for the X and Z axis though.
case AxisOptions.ForwardAxis:
angle = Mathf.Atan2(Input.acceleration.x, -Input.acceleration.y)*Mathf.Rad2Deg + centreAngleOffset;
break;
case AxisOptions.SidewaysAxis:
angle = Mathf.Atan2(Input.acceleration.z, -Input.acceleration.y)*Mathf.Rad2Deg + centreAngleOffset;
break;
Does anybody know how to apply this same technique to read from the Y axis? I feel like I’ve just been confusing myself and the answer is right in front of me…
