Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Incorrect compass magneticHeading (Compass calibration needed ?)

Discussion in 'Scripting' started by bibloc, Jan 6, 2021.

  1. bibloc

    bibloc

    Joined:
    Jan 31, 2018
    Posts:
    17
  2. nilsdr

    nilsdr

    Joined:
    Oct 24, 2017
    Posts:
    374
    You can not rely on the compass to be accurate, it is always an indication. Compasses in iPhones are relatively precise, but the quality of the compasses in Android phones varies greatly. Also the readings can be disturbed by a million external factors that you can not control or predict.

    There isn't really a reliable way of telling whether or not a compass needs calibration. To know if the value you're getting from the sensor is correct you would need the real world heading to compare it to, so you've got yourself a bit of a chicken and egg problem.
     
    bibloc likes this.
  3. bibloc

    bibloc

    Joined:
    Jan 31, 2018
    Posts:
    17
    Thanks for your answer !
     
  4. agrmayank

    agrmayank

    Joined:
    Sep 26, 2018
    Posts:
    3
    I have the same issue. The thing is I am getting correct values in build or native compass apps but when using unity, the values are really really different and completely wrong!!!
     
  5. paulksi

    paulksi

    Joined:
    Nov 9, 2015
    Posts:
    27
    Same here, galaxy tab s5e,i found that you must not use magnetic covers for the device, it gets inacurate readings, and if you left your tablet off for a while, you should rotate and flip in order to calibrate it