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.

Re: Using Compass sensor in android phone

Hello.

Please update Online Maps through built-in update to the latest beta version.
Online Maps v2.4.0.23+ has a compass threshold.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: Using Compass sensor in android phone

Thank you for this quick answer.
I didn't found the menu entry "Chek updates" under "Component / Infinity Code / Online Maps"
The documention on this part seems easy
"Online Maps has built-in update system, using which you can update Online Maps to the latest version and get early access to all versions and updates. Click «Component / Infinity Code / Online Maps / Check Updates», to open the window checking for updates".
... But i can't see this update possibility.
My Unity version is 5.3.4f1 and Online Maps is 2.3.0.18

Re: Using Compass sensor in android phone

Sometimes Unity Editor does not display these menu items.
Unfortunately, I do not know why.
You can use alternative way «Online Maps Inspector / Help / Check Updates».

P.S. In Online Maps v2.4.0.11+, Check Updates, Playmaker Integration Kit and About now located in GameObject / Infinity Code / Online Maps.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: Using Compass sensor in android phone

Hello, i used your alternative way with «Online Maps Inspector / Help / Check Updates» to download the last beta 2.4.0.30.
The new compass threshold option solved my problem... The map rotation is now very stable.
Thank you for quick help.