Version: Unity 6 Preview (6000.0)
LanguageEnglish
  • C#

Gyroscope.attitude

public Quaternion attitude;

Description

Returns the attitude (ie, orientation in space) of the device.

using UnityEngine;

public class Example : MonoBehaviour { // Rotate the object to match the device's orientation // in space. void Update() { transform.rotation = Input.gyro.attitude; } }