【Unity Remote 5】実機の画面が動かない
ジャイロを有効にしていないだけだった
構成
VR Player
┗ Main Camera
VR Player
に以下のスクリプトをアタッチ
GyroRotate.cs
using UnityEngine;
using System.Collections;
public class GyroRotate : MonoBehaviour {
private Gyroscope gyro;
void Start ()
{
if (SystemInfo.supportsGyroscope)
{
gyro = Input.gyro;
gyro.enabled = true;
}
else
{
Debug.Log("Phone doesen't support");
}
}
void Update ()
{
transform.Rotate (-Input.gyro.rotationRateUnbiased.x, -Input.gyro.rotationRateUnbiased.y, 0);
}
void OnGUI()
{
GUILayout.Label ("Gyroscope attitude : " + gyro.attitude);
}
}
これでUnity側でGame Windowを見ている間、スマホ実機のジャイロを取得して画面を動かすことができる。
参考
【Unity】「Unity Remote 5」の使い方
How to enable head tracking in Gear VR via Unity Remote 5 on android?
Author And Source
この問題について(【Unity Remote 5】実機の画面が動かない), 我々は、より多くの情報をここで見つけました https://qiita.com/mczkzk/items/a368096dca6d0ea662f6著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .