I want the camera to rotate around an object in Y axis, when you rotate your phone. how can i do this?
i already have the code to do it using mouse, but i need it to turn with compass. here's the code for movement with mouse:
mouseX = Input.GetAxis("Mouse X");
offset = (Quaternion.AngleAxis(mouseX * cameraSpeed, Vector3.up) * offset);
transform.position = point + offset;
transform.LookAt(point);
i know that setting the mouseX value to change with compass direction is my answer, but how can i do it?