Unity iOS gyroscope always returns constant value

79 views Asked by At

I'm reading the gyroscope on a Unity iPhone app but however I move the phone it returns the same value it returns is always the constant value of (0.00000, 0.00000, 0.70711, -0.70711).

I'm reading it along the lines of this:

void Start()
{
    Input.gyro.enabled = true;
    Debug.Log("Using Gyro for player rotation.", this);
}

void Update()
{
    Debug.Assert(Input.gyro.enabled);
    Debug.Log($"Gyro: {Input.gyro.attitude}");
}

The same approach works in a separate Unity iOS app.

  • My app also targets the Quest, and includes the Quest integration (this does not cause problems on the other iOS app).
  • Unity 2022.2.19. iOS 16.5.1. iPhone 11.
  • I have set a value for "Privacy - Motion Usage Description" in Info.plist.
  • The gyro outputs data correctly when I test it in the Editor using Unity Remote 5. (This also confirms the gyro works on my phone.)
  • I have tested on an iPad Air 3 with the same results

Any idea what's going on?

0

There are 0 answers