Hey!
Does anyone have a simple way of making an already existing GameObject in Unity rotate in the same manner as the Iphone through retrieving Gyroscope data, by attaching C#-code?
This is what I have so far, but it might be wrong…
using UnityEngine;
using System.Collections;
public class GyroRotate : MonoBehaviour {
void Start ()
{
Input.gyro.enabled = true;
}
void Update ()
{
transform.Rotate (Input.gyro.rotationRateUnbiased.x, Input.gyro.rotationRateUnbiased.y, Input.gyro.rotationRateUnbiased.z);
}
}
Thanks beforehand!