Search Unity

Unity compass yields random results on Android

Discussion in 'Handheld AR' started by waldgeist, Sep 13, 2019.

  1. waldgeist


    May 6, 2017
    We're developing an AR app and trying to align the world to the user's heading. On iOS, this works very well, but on Android we noticed completely random results, depending on the respective device.

    On an Xiaomi Mi9, for instance, the true heading stays in the same range (around 350°), independent of the device orientation. It changes a bit, but not much. On other devices, it is slightly better. I've tried other Unity compass apps on Github, they all show the same problem.

    There are native apps, however, that do not show the heading errors, notably "Gps Map". This works very smooth on the Xiaomi, and North is always where North should be. Others show the same errorneous behaviour as the compass info in Unity.

    Any ideas why this happens and what apps like "Gps Map" do better than Unity? I am a bit clueless about how to approach this problem, especially as different devices seem to be affected differently. Thanks.