14 lines
399 B
C#
14 lines
399 B
C#
using UnityEngine;
|
|
|
|
public class TesGyroLangsung : MonoBehaviour
|
|
{
|
|
void Update()
|
|
{
|
|
Quaternion deviceRotation = Input.gyro.attitude;
|
|
deviceRotation = new Quaternion(deviceRotation.x, deviceRotation.y, -deviceRotation.z, -deviceRotation.w);
|
|
transform.localRotation = deviceRotation;
|
|
|
|
Debug.Log("Gyro langsung ke kamera: " + deviceRotation.eulerAngles);
|
|
}
|
|
}
|