Guest User

Untitled

a guest
Jun 10th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.33 KB | None | 0 0
  1.     // Update is called once per frame
  2.     void Update()
  3.     {
  4.         transform.rotation = GyroToStuff(Input.gyro.attitude);
  5.     }
  6.  
  7.     private static Quaternion GyroToStuff(Quaternion q)
  8.     {
  9.         float a;
  10.         Vector3 b;
  11.         q.ToAngleAxis(out a, out b);
  12.         return Quaternion.AngleAxis(a, Vector3.back);
  13.  
  14.     }
Advertisement
Add Comment
Please, Sign In to add comment