How to get GPS coordinates in unity 3d
<p>I got this code for getting the GPS coordinates but somehow I only got an output of the same coordinates. IT does not change the output where ever I go and sometimes I got 0 for latitude and 0 for longtitude as output please someone help me or someone have a syntax in getting the coordinates </p>

<pre><code>using UnityEngine;
using System.Collections;
using UnityEngine.UI;


public class testlocation : MonoBehaviour {

    public void Start()
    {

        // turn on location services, if available 
        Input.location.Start();
    }

    public void Update()
    {
        Text singleText = GameObject.Find("SinglePlayerButton").GetComponentInChildren&lt;Text&gt;();

        //Do nothing if location services are not available
        if (Input.location.isEnabledByUser)
        {
            float lat = Input.location.lastData.latitude;
            float lon = Input.location.lastData.longitude;



            singleText.text = "Depart lat: " + lat + "lon: " + lon;

        }
        else
            singleText.text = "gps off";
    }



}
</code></pre>