Input.compass does not work on Android when the Active Input Handling is set to Input System Package (New)

When the Active Input Handling is set to Input System Package (New), and I build and run to my Android device, the Input.compass.TrueHeading always returns 0.

I was able to work around this by setting the Active Input Handling to Both, but this flags a warning that it is not supported on Android.

“PlayerSettings->Active Input Handling is set to Both, this is unsupported on Android and might cause issues with input and application performance. Please choose only one active input handling. Ignore and continue? (This dialog won’t appear again in this Editor session if you’ll choose Yes)”

This is not ideal. I saw a previous post on how Input.location was updated to circumvent this problem. It seems like Input.compass never got the same treatment? Or if it did, it is broken.

The documentation also indicates there is no equivalent in the New Input System.
https://docs.unity3d.com/Packages/com.unity.inputsystem@1.11/manual/Migration.html

1 Like

Having the exact same problem, Unity hasn’t implemented a new compass API so if you’re using the new input system you can just never access the compass. I’ve tried to extrapolate the compass heading using the device orientation, magnetic field sensors, etc, and it’s a huge pain that doesn’t work consistently.

I just can’t believe it’s been 3 or 4 years since InputSystem was released and they still haven’t implemented the compass sensor.

EDIT: I did find an article announcing that it would be added in unity 6. There are no docs confirming this, and it definitely isn’t part of Input System 1.11.2 and hasn’t been backported to 2022 LTS.

EDIT 2: Yeah, it’s also not in Unity 6 and it’s not on any of the roadmaps.