Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma strict
- private var quatMult : Quaternion;
- private var quatMap : Quaternion;
- function Start () {
- // Adjust the rotation based on how the phone is being held
- // NOTE: in FOV2GO this is in the Awake() script
- Input.gyro.enabled = true;
- }
- function Update () {
- #if UNITY_ANDROID
- quatMap = Input.gyro.attitude;
- #endif
- transform.localRotation = Quaternion.Euler(90, 0, 0) * quatMap * Quaternion(0,0,1,0) /*quatMult*/;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement