Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
4
Question by Ravi M L · Nov 08, 2012 at 07:10 AM · coordinatesgps

How to get GPS coordinates in unity 3d

Hi All,

How to access the GPS coordinates in unity3d for Android application.

Please guide me in steps to know about GPS coordinates.

Thank you in Advance.......

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image shipra · Nov 12, 2013 at 07:05 AM 0
Share

Hi Please let me know if you have found the solution for this problem as I am facing the same issue

3 Replies

· Add your reply
  • Sort: 
avatar image
14
Best Answer

Answer by Seth-Bergman · Nov 09, 2012 at 06:02 AM

step 1. look here:

http://docs.unity3d.com/Documentation/ScriptReference/LocationInfo.html

http://docs.unity3d.com/Documentation/ScriptReference/LocationService.html

Well, that about covers it

Seriously though, you need to start it through input, with the line:

Input.location.Start();

here's the Script Example: http://docs.unity3d.com/Documentation/ScriptReference/LocationService.Start.html

http://docs.unity3d.com/Documentation/ScriptReference/Input-location.html?from=LocationService

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Ravi M L · Nov 26, 2012 at 07:28 AM 0
Share

Thank you for your Valuable reply.

I tested to get GPS coordinates as you mentioned in the above link. But it is showing an error messages as:

BCE0019: 'latitude' is not a member of 'UnityEngine.LocationService'. BCE0019: 'longitude' is not a member of 'UnityEngine.LocationService'.

The same error is showing for all the remaining values of altitude, horizontalAccuracy and timestamp.

Please explain briefly to get GPS co-ordinates.

Thank you in advance...

avatar image Ravi M L · Nov 27, 2012 at 07:02 AM 1
Share

0

I solved the above errors.

I just changed lines Input.location.lastData.longitude ins$$anonymous$$d of Input.location.longitude

After solving the problem it just showing the location as (0,0,0,0). I am running this script by attaching to $$anonymous$$ainCamera in unity3d.

I din't used any of the devices. Please explain Which are the things required to show the location ?

Thank you in advance....

avatar image Ravi M L · Nov 27, 2012 at 12:05 PM 1
Share

I solved the problem of above errors.

I just changed lines Input.location.lastData.longitude ins$$anonymous$$d of Input.location.longitude

After solving the problem it just showing the location as (0,0,0,0). I am running this script by attaching to $$anonymous$$ainCamera in unity3d.

I din't used any of the devices. Please explain Which are the things required to show the location ?

Thank you in advance....

avatar image
0

Answer by ejpaari · Nov 12, 2013 at 07:31 AM

Here is an example: http://docs.unity3d.com/Documentation/ScriptReference/LocationService.Start.html

Just make sure you have checked "Input.location.isEnabledByUser", "Input.location.Start();" and "Input.location.status" like in the example above.

In addition if you want to make conversions you can start here: http://en.wikipedia.org/wiki/Latitude#The_length_of_a_degree_of_latitude

http://en.wikipedia.org/wiki/Decimal_degrees

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by ethanlish · Sep 07, 2019 at 09:28 AM

Make sure that you update player settings to allow 'Promotion support' and add text to 'Location Usage Description'

Thanks, E,Make sure in player settings you check 'Promotion support' and add some text to 'Location Usage Description'

E

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

15 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to import GPS location coordinates in to Unity ? 1 Answer

How do I make LocationService.Start work? 2 Answers

Lat Long to Unity world coordinates 1 Answer

GPS coordinates (lat/long/altitude) to Unity 3D coordinates (x, y, z) 1 Answer

how to convert gps coordinates to unity 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges