I’m creating a Gear VR app, I want test it via unity remote 5…Any idea?
I found the solution. Put the MainCamera into a empty object with Player tag and add this script into MainCamera:
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 ()
{
GameObject player = GameObject.FindGameObjectWithTag ("Player");
player.transform.Rotate (-Input.gyro.rotationRateUnbiased.x, -Input.gyro.rotationRateUnbiased.y, 0);
}
void OnGUI()
{
GUILayout.Label ("Gyroscope attitude : " + gyro.attitude);
}
}