Before updating to Windows 10 you may need to return your Pro license. More information here

GPS location string

Hey guys

Is there an importable GPS string location which can be retrieved from iphones or android devices into unity? For example, I want to run different code depending on where the player is in the real world, however I don't want to use precise gps locations. Rather, if the phone knows the player is in "derp park" or whatever , then it would fire a script.

more ▼

asked Mar 15, 2012 at 08:53 AM

avatar image

259 72 68 79

No. You will have to match a precise position to an area. There may be a service doing right that, but you will need a position first.

Mar 15, 2012 at 09:01 AM felix.

Damn, I thought that might be the case.

In that case, would I be able to create 4 positions, creating a square, around the players location, creating A broader area? And then react when that square moved covered other set coordinates for locations? (Such as the afformentioned park?

Mar 15, 2012 at 09:10 AM Captain_Dando

@Captain_Dando- Can you stop posting comments in the Answer section? It messes up conversation ordering, and makes work for me.

Mar 15, 2012 at 09:46 AM syclamoth

Well, you get a latitude and a longitude - the "most correct" way would be to have your character on a sphere :) but for your local problem, you can simply approximate them as x,y coordinates. If you need something global, have a look at map projection techniques.

Mar 15, 2012 at 10:12 AM felix.

Thanks for the help guys, you've officially answered all my questions. I don't think I need any more help but i thought I'd share what I'm up to anyways. The map system isn't the main component in my game and I'm debating whether that virtual world would even be shown at all. as it stands, this is the system I am going to use;

the person doing the exploring will be given a tag (something coordinates). that tag controls his object in the virtual map. when that object collides with objects on the virtual map (which correspond with the real world coordinates) a script will be run. Upon leaving the collider, the player will be outside, in unimportant areas, which don't need to be logged.

in order for unity to interpret the gps position I will flatten the gps coordinates to full numbers, and scale the game to fit those numbers with unity's own coordinates. It will take a long time, but after many months of gradually adding colliding objects to the game world I will have a vast library of locations to trigger separate scripts.

Mar 15, 2012 at 10:18 AM Captain_Dando
show all comments (comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

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

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments



asked: Mar 15, 2012 at 08:53 AM

Seen: 1948 times

Last Updated: Mar 15, 2012 at 01:32 PM