Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Update is called once per frame
- void Update()
- {
- transform.rotation = GyroToStuff(Input.gyro.attitude);
- }
- private static Quaternion GyroToStuff(Quaternion q)
- {
- float a;
- Vector3 b;
- q.ToAngleAxis(out a, out b);
- return Quaternion.AngleAxis(a, Vector3.back);
- }
Advertisement
Add Comment
Please, Sign In to add comment