- Home /
GPS location on Android
Hi, I'm trying to read the location of my device in Unity. Maybe I'm doing something worng but I couldn't find any Example how to do it the right way.
var textObject : GameObject;
var loc = new LocationInfo();
function Update () {
textObject.guiText.text = "Latitude: " + loc.latitude ;
}
In this case I'm just trying to print the latitude to a GUIText object but it always gives me zero. I would really appreciate any help!
Answer by ina · Jun 12, 2011 at 02:15 AM
Try iPhoneInput.lastLocation.latitude
Does iPhoneInput works for Android?
Otherwise, does someone knows a suitable plugin?
Your answer
Follow this Question
Related Questions
Instancing LocationInfo upon each call or on Start 0 Answers
Convert LatLong values into unity coordinates and display hotspots in Camera View 0 Answers
Unity Android Inputs With Samsung Galaxy Ace 0 Answers
Launching "Locations and Security" Android Menu from Unity? 0 Answers
Embed device maps into unity 3D 0 Answers