- Home /
point the north
hi
I want create an application for mobile, that rotate an object in the center of the screen for point the north, only in 2d (like a compass). So, if i rotate the phone, the object rotate for point the North.
for try, I try to rotate of 1 degree and i use rotateAround(Vector3d.zero, Vector3d.up, 1) and it work
for obtain the rotation angle i use input.Compass.magneticHeadling, if i print the angle, is very low and the object doesn't rotate right, but a little bit.
what I can use for rotating ? How i can obtain the angle for put it in rotateAround?
sorry for my bad english
Answer by JonPQ · Jan 11, 2019 at 06:57 PM
the angles maybe in Radians vs degrees. Check the documentation for both rotateAround() and Compass.magneticHeading you may just need to multiply your number by a scalar converter... e.g. Mathf.degstoRadians or Mathf.radians2Deg degrees are 0-360 radians are only 0 to 2xPi (about 0 to 6.3)
Your answer
![](https://koobas.hobune.stream/wayback/20220612185556im_/https://answers.unity.com/themes/thub/images/avi.jpg)