x


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

Captain_Dando gravatar image

Captain_Dando
229 72 67 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

It would be a lot easier to create some box collider (or an arbitrary geometry with a mesh collider) for the park and check whether your player (as moved by GPS coordinates) is inside that collider.

Mar 15, 2012 at 09:14 AM felix.

Does that work with real-world coordinates? I think I get what you're saying, do you mean that the player would have a parrallel position In the game world as in the real world, with the cube being placed in the center of the gps coordinates relative position In game?

(On a side note, sorry if my responses are a bit strange, I'm only recently delving into iphone and android development)

Mar 15, 2012 at 09:43 AM Captain_Dando

Yes, I think you understand what I mean. Player is moved by GPS, area checking geometry is fixed. When Player enters some area, you get notified and can do what you want with this information.

Mar 15, 2012 at 09:52 AM felix.
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

By RSS:

Answers

Answers and Comments

Topics:

x2230
x674
x131
x46

asked: Mar 15, 2012 at 08:53 AM

Seen: 1848 times

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