Topic: Using Compass sensor in android phone
Hi,
I tried to integrate in my Unity application a Tile map oriented from data given by Compass sensor on Android phone
I found a simple script code in Atlas of examples "Rotate the camera on a compass" (http://infinity-code.com/atlas/online-maps/)
using UnityEngine;
public class CameraWithCompass : MonoBehaviour {
private void Start()
{
OnlineMapsLocationService.instance.OnCompassChanged += OnCompassChanged;
}
private void OnCompassChanged(float f)
{
OnlineMapsTileSetControl.instance.cameraRotation.y = f * 360;
}
}
Attached to the map object this script works quite fine, but the map rotation on phone is too much jerky...
I would like to know if there is a simple way to modify the script code above using average information from compass,... or reduce this sensor sensibility.