Unity 5.6.1f1
Edit > Project Settings > Player > Android Tab > Check Virtual Reality Supported > Split Stereo Display (non head-mounted)
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class gyroRotate : MonoBehaviour { | |
void Start () { | |
} | |
void FixedUpdate () { | |
Input.gyro.enabled = true; | |
Quaternion gyro = Input.gyro.attitude; | |
Vector3 gyroEular = gyro.eulerAngles; | |
transform.rotation = Quaternion.Euler(-gyroEular.y, gyroEular.x, 0) * Quaternion.Euler(90, 0, 0); | |
} | |
} |
Unity 5.6.1f1
Edit > Project Settings > Player > Android Tab > Check Virtual Reality Supported > Split Stereo Display (non head-mounted)