top of page

TOSHICHAN
Unityでスクリプト&簡単な実装サイト
向いてる方向を向く
[SerializeField]private GameObject Objects;
void Start () {
Input.gyro.enabled = true;
}
void Update () {
Quaternion gattitude = Input.gyro.attitude;
gattitude.x *= -1;
gattitude.y *= -1;
Objects.transform.localRotation = Quaternion.Euler(90, 0, 0) * gattitude;
}
bottom of page