1

So I've been trying to find an article on the topic but I haven't been able to find one so here's my last resort.

Basically on my android device when I print out the values of Input.compass.magneticHeading the print logs could look smth like

330
330
330
27
330
330
330
27
27
330
330
27
330
330
330

And any direction I look towards, the print always prints a number like the 330 mentioned way more than the 27.

Is this just how compasses work? Or am I doing something wrong

Ideally I'd want it to print only one value

derHugo
  • 83,094
  • 9
  • 75
  • 115
tyh
  • 11
  • 1
  • how are you holding the phone? According to the docs `The value in this property is always measured relative to the top of the screen in its current orientation.` so it might have an issue if you hold the phone upright (like for taking a picture) .. – derHugo Oct 05 '22 at 08:29
  • hi thanks for the reply, I realized after testing with another device it was only the original device that had compass issues. I'm not sure if its a compass thing or a unity thing, but when I hold the phone facing 180 degrees, it prints values around 180 (which is correct). When i move 10 degrees to the left (170), it would print 170s and 190s almost as if the compass thinks I'm moving in both directions by the angle moved in real life. Other phones dont have this issue though so i dont really know – tyh Oct 06 '22 at 03:16

0 Answers0